Блог пользователя _its.abhinav_

Автор _its.abhinav_, история, 3 года назад, По-английски

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

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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