_its.abhinav_'s blog

By _its.abhinav_, history, 3 years ago, In English

My code is of the order of n but still, it is giving TLE, can anyone fix the issue where am I making the mistake. My submission Problem B of latest codeforces round 712 DIV2

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

That is not possible. You might have used some function in your submitted code that would have made your code's complexity not executable in time bounds.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Your isSame function runs in O(n) complexity just because every time you pass string the function creates a copy of both the strings.