Can we do it by 2d array instead of pair?

can we solve the question using 2d array instead of using pair?

@jaankita2000
You can either make a 2D array of string or int. Neither of these would be able to hold the data as you need to store an int as well as a string and then do the sorting. While there are surely other ways to solve this problem as well , the method discussed in the video is the simplest and most efficient of all.

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.