save(num) stores a number; best() removes and returns the most frequent one, breaking ties by whichever was saved last.
save(num) stores a number; best() removes and returns the most frequent one, breaking ties by whichever was saved last.
Opens with the full question.