I tried a lot… but not finding my bug…
What’s the problem??? I can’t open it.
Link is given Brother…
Here u go Solution
In this competition i got 4th rank
Your logic & my logic is almost same, but dont understand where is the bug…
Instead of iterating from 0 to <n try to iterate from 0 to string.length(), during the competition I also face same problem when I treating from 0 to n it shows wrong answer but when I treating from 0 to string.length it accepted.
You’re Right , brother…
But what is the problem in n??
I don’t know i tried many times during contest but no result finally i tried to replace n with s.length and it accepted.
The length of string gets changed due to s.clear() and s.insert()
but in my code i didn’t use s.clear and why it is changed there is a specific reason for that??
Can you please provide the link of both codes ( WA and AC ) ?