Ad
  • Custom User Avatar

    There are 2 problems I see with your current code:

    • You're calling strlen() on each loop iteration, causing a timeout.
    • You're using char* (aka string) to count things: that's definitely not the right type for the job.
  • Custom User Avatar

    O(len(s1+s2)) is an expectedc complexity for this problem, and you seem to get this part right.

    I just tried your solution and I get no timeout, just incorrect answers in large tests?