Junior — Senior
Determining the element with the highest frequency in the array
livecode
Task condition
It is necessary to implement the count_frequency function, which returns the element that occurs most frequently in the list.
def count_frequency(data):
# TODO: Implement the function
pass
# Test the function
items = [2, 3, 2, 4, 5, 6, 4, 5, 2, 4, 4]
most_common = count_frequency(items)
print("Frequency:", most_common)