one test case wrong
Dictionary order larger doubt
Hi @Aayush_25 ,
Try this testcase :
Input : cabd
Expected Output :
cadb
cbad
cbda
cdab
cdba
dabc
dacb
dbac
dbca
dcab
dcba
Your Output :
cadb
cbad
cbda
cdab
cdba
dcab
dcba
dacb
dabc
dbca
dbac
Since this is a tricky problem and even I spent quite some time when I was doing the course before I finally figured it out , I’ll just give you one additional hint … Sorting something might help.
but we dont need to print the sorted result in this ques…i changed my comparison from (>) to strcmp and it worked…
@Aayush_25
I never said you had to sort the final output. The “something” in my hint referred to sorting something else. If your way around worked for you , then it’s good. I had something else in my mind which would also have given you a full score.
what i meant is that the expected output you sent me was not correct maybe because the same code now passed all cases…anyways can you send me the other approach as well ?
@Aayush_25
I can share my code with you on personal chat since you have already got a working solution of your own.