the output for 1,2,3 should be 1 0 2 but i m getting 0 1 2 and also please tell how to sort map with respect to its value
Can you please tell me where i am going wrong
You can use map for this
cause of wrong logic, do you want me to tell you the right approach?
yes please!!!
Have added comments for better understanding, it will give you 100% score too
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.