Loading...
Loading...
Loading...
A hash table with m buckets stores each key in bucket key % m and keeps colliding keys in a list. Print the length of the longest bucket after all keys are added. Keys are distinct.
Example 1
Input
8 3 11 19 6 14 22 30 1
Output
4
Slot 6 holds 6, 14, 22 and 30.
Example 2
Input
4 1 2 3
Output
1
Try the problem first. Open one hint at a time.
Count how many keys fall into each remainder.
A Counter of key % m gives all the bucket sizes at once.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor