Complete the method which returns the number which is most frequent in the given input array. If there is a tie for the most frequent number, return the largest number among them.
Note: no empty arrays will be given.
The solution in Golang
Test cases to validate our solution