Return the most frequent value in the non-negative integer array Z. If there is a tie, return the smallest such value.
Z
solve(...)