def findMostFrequent(arr): 
    count_arr = {} 
    for i in range(len(arr)): 
        if arr[i] in count_arr: 
            count_arr[arr[i]] += 1
        else: 
            count_arr[arr[i]] = 1
    max_frequency = max(count_arr.values()) 
    for key,value in count_arr.items(): 
        if value == max_frequency: 
            return key
Scrivi una funzione per trovare l'elemento più frequente in un array.