Robi interview question

Solve the algorithmic question about hashmap.