Someone please help me

Problem link: https://www.codechef.com/NACA2019/problems/NUMTED
My solution link: https://www.codechef.com/viewsolution/24461131

I tried a lot… but not finding my bug… :cry:

What’s the problem??? I can’t open it.

@ssrivastava990
Link is given Brother… :blush:
Numbers Wanted.
Code:: NUMTED

Here u go Solution

In this competition i got 4th rank :smiley:

Your logic & my logic is almost same, but dont understand where is the bug… :cry:

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.

1 Like

You’re Right , brother… :heart_eyes::heart_eyes:
Got AC.
But what is the problem in n??:face_with_hand_over_mouth::thinking:

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.

I think more experience coder will help.
@aryanc403 @vijju123

The length of string gets changed due to s.clear() and s.insert()

1 Like

Thanks brother… :heart_eyes:

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 ) ?