Need help to understand where I'm going wrong

I tried to solve this question using the STL next_permutation() but I’m getting wrong answer. The output of test runs seem to be fine. Can you tell me if my logic is wrong somewhere?

Hey @pawan2179
Use a vector instead of string
because it will work fine only for 1digit nums but not for 2digit or bigger numbers.
Try this
3
22 23 12

If this resolves ur query then please mark it so :slight_smile:

Hey @pawan2179
Is this resolved ?? :slight_smile:

No
I tried using vector but only one test case is getting passed

Please share your code in Coding Blocks Ide :slight_smile:

Collaborate Mode is on already

Hey @pawan2179
Please share it like this :
go to this : https://ide.codingblocks.com/
paste ur code
press Ctrl+ S and then click on save
Then share the URL with me

Ok sorry I didn’t knew how to share.
Here’s the code : https://ide.codingblocks.com/s/352671

Hey @pawan2179
You cant use next_permutation as u dont have to produca any identical permutation which next perm will .Here see this code for reference,about how to do this : https://ide.codingblocks.com/s/324685?_ga=2.133610318.1350203873.1600106484-1795954092.1597348154

Got it.
Thankyou for your help @Kartikkhariwal1

1 Like