I tried solving this question.
Will anyone please tell me why my first submission is giving WA when I am using a map to perform the same task as in submission 2 which got an AC.
WA Code:- CodeChef: Practical coding for everyone
AC Code:- CodeChef: Practical coding for everyone