WA in Digital Dictionary

Can anyone please figure out the mistake in my code.
For the test cases it is passing, But giving a wrong answer verdict while submitting.
Link to my code :