Homework 3: Finding heavy elements with Karp's algorithm