two test cases not passed
https://ide.codingblocks.com/s/55487
Recursion-Dictionary Order(Larger)778
Hi Aastha, consider the case where
Input: abc
Expected Output:
acb
bac
bca
cab
cba
Your code’s output:
acb
bac
bca
cba
cab
The last two permutations are not in correct order, so try to work on your logic in this regard and reply to this thread in case of any queries.
i understood my mistake but i am not able to rectify it
Hi Aastha, I’ve made some changes to your code and now it is working correctly. Go through the code and reply to this thread in case of further queries:
https://ide.codingblocks.com/s/62131.
the recursion order dictionary larger is working fine. thanks a lot. but after changing the conditions for smaller case sample test cases are passed but 3 test cases are wrong
You can share the code here.
thanks. its done now.
Hey i just want to insert character arrays in set, but i am unable to do so.Kindly help !!
here is my code link,
https://ide.codingblocks.com/s/66922
@Tanay-Burreja-479544972538432 why are using set you can implement without using it. just design a compare function and in permute function pass copy string if you don’t understand ping me i wiil make changes in your code
make the character array in string and then insert the string
set s
https://ide.codingblocks.com/s/67000
updated link.
Hey @phantom,
I have made the changes still last test case is failing.
I guess my approach is incorrect, If so kindly suggest some alternative approach.
@Tanay-Burreja-479544972538432 I only changing permute function now you have to only design compare function think about it and you are done. you can refer this this.
My Solution PAssing all testcases.
link =