Loading...
Loading...
Loading...
A table has m slots. A key goes to slot key % m. For each key, in the order given, print its slot.
Example 1
Input
8 105 212 37 98 13 45
Output
1 4 5 2 5 5
13 and 45 both go to slot 5.
Example 2
Input
5 0 5 10
Output
0 0 0
Try the problem first. Open one hint at a time.
Use the remainder operator with the table size.
Collect the slots in a list and print them with print(*slots).
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor