Problem link: CodeChef: Practical coding for everyone
My solution link: CodeChef: Practical coding for everyone
I tried a lot… but not finding my bug…
Problem link: CodeChef: Practical coding for everyone
My solution link: CodeChef: Practical coding for everyone
I tried a lot… but not finding my bug…
What’s the problem??? I can’t open it.
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…
Got AC.
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()
Thanks brother…
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 ) ?