Question: 
Write a python function to find the item with maximum occurrences in a given list.


Model's Code:
def max_occurrences(lst):
    from collections import Counter
    count = Counter(lst)
    max_count = max(count.values())
    return tuple(item for item, freq in count.items() if freq == max_count)



Sample Correct Code:
def max_occurrences(nums):
    max_val = 0
    result = nums[0] 
    for i in nums:
        occu = nums.count(i)
        if occu > max_val:
            max_val = occu
            result = i 
    return result


Asserts:
assert max_occurrences([1,2,3,1,2,3,12,4,2]) ==  2
assert max_occurrences([1,2,6,7,0,1,0,1,0]) == 1,0
assert max_occurrences([1,2,3,1,2,4,1]) == 1


Tests:
Test 1 of 3: FAIL: AssertionError()

Test 362 of 974: 261/362 (72.09944751381215%): failed