Hashing

Answer & solution
Official answer: B
Cubing permutes decimal residues: 0, 1, 8, 7, 4, 5, 6, 3, 2, 9. Therefore each block of 10 consecutive keys places one in each bucket. Among 2021 keys bucket 0 gets 203 and every other bucket 202, optimally balanced. Squares use only six residues, 11i² is identical modulo 10, and 12i only reaches even buckets. Thus B.
Only the last decimal digit matters modulo 10. Cubes of residues 0 through 9 give 0, 1, 8, 7, 4, 5, 6, 3, 2, 9, which is a permutation. Each full ten-key block therefore hits every bucket once. The 2021 keys consist of 202 full blocks plus one extra key 0 mod 10, giving counts 203, 202, …, 202, as balanced as possible. Squaring collapses residues, 11i²has the same residues as i², and 12i≡2i can only reach even buckets.