Test case 0,1,2, failed

hello
pls check why my test cases passes only 1 test case

Please share ur code. I will try to find the error by tomorrow morning and till then please try more problems on hackerblocks.

here you go:

Can u explain the logic to me … because i have done this question in a different way so i am having difficulty understaning ur lgc.

i am using the logic explained in the video and since we have to print it in sorted order i am using multiset

Ok let me see the video and then I will revrt back to u

here is the updated code:


it fails test case 2