Trivial one-line Python fast solution, log(n) space


  • 0
    E

    Not sure what the question meant by "no extra space". It might be possible to have a solution with O(1) additional space, but notably none of the other solutions I looked at solved it in constant space either.

    '''def isPalindrome(self, x):
    return str(x)==str(x)[::-1]'''


Log in to reply
 

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