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?
Need help to understand where I'm going wrong
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
No
I tried using vector but only one test case is getting passed
Please share your code in Coding Blocks Ide
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
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