2 test cases not passing
you are printing the letters in alphabetical order and not the order in which they are present in the array , that’s where you are going wrong.
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.
@saurabh_singhCmn
i have made changes then also it’s not passing please see to it
and correct my code
I have manually Checked it its working for unordered strings also
please see to it
It still is wrong. You are increasing the map value without setting it again to 0. Actually you don’t require a map at all for this. Just iterate over I and then iterate from i to n and check till where am I getting the same character as ith. Immediately break when unequal and append j - I to answer and now set i to j.
@saurabh_singhCmn
I understood your approach
can you please comment down the mistake in my code
i really need to find the mistake in my code