Find the most repeated element in an array.
Asked in the Round 2 stage. The expected approach uses a hashmap.
Implement most_repeated_element(array). Return the element with the greatest frequency. If multiple elements have the same greatest frequency, return the one whose first occurrence has the smallest index.
def most_repeated_element(array):