Sort Game by using maps

this is my code its working fine upto expectation just help me figuring out how to sort it by integers accordingly.
here is my code:

hey @Vivek-Pandey-2129725577345937 map isn’t really the right data structure for solving these kind of problems i’ll suggest you to make an array of pairs of string and int and then using custom comparator function for sorting them.
Please use this as reference code for the same:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.