Absurd TLE in Python solution for input "a"

  • 0

    I get a time limit exceeded error with the test case

    Last executed input: "a"

    This seems incredibly stupid because the first five lines in the function are:

        if s == '': 
            return 0
        elif len(s) == 1: 
            return 1
        else:  (other stuff)

    The code works perfectly locally, and I can't imagine how the len function would be too slow on this input.

    This is absurd. Any input?

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.