Unlock using hashmap


why is it giving wrong answer and run time error