Dictionary order (smaller)

My code is giving right output for sample test cases but is failing to get submitted.
Please help.

hello @rahul.gupta03111999

u have already sorted the input , so there is no need of line 14. comment it and then try

getting wrong output sir

checking. . . . . . . . .

@rahul.gupta03111999

some order issue is there, for now generate all valid strings, store it in vector .
then sort the vector and print it

check ur updated code here->

1 Like

Sir,if you don’t mind asking me, why are we storing the strings in the vector and then printing it,I mean it was anyway giving the right answer. What’s the need of a vector here?

see output is correct,but thier order is not correct (we want sorted order) .
that is the reason why we stored all valid string in vector.
then sort the vector (so that stored string become in sorted ordera)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.