logo CodeStepByStep logo

max_occurrences

Language/Type: Python collections dict

Write a function named max_occurrences that accepts a list of integers as a parameter and returns the number of times the most frequently occurring integer (the "mode") occurs in the list. Solve this problem using a map as auxiliary storage. If the list is empty, return 0. Do not modify the list passed in as a parameter.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.