Code Accepted on my phone but showed Runtime Error on laptop


  • 0
    J

    I submit the same code below on the leetcode webpage through my phone and on my laptop. On the phone it shows accepted, but on my laptop it shows there is an runtime error. So I am wondering if there is something wrong.

    class Solution(object):
        def isPalindrome(self, x):
            """
            :type x: int
            :rtype: bool
            """
            x1 = [::-1]x
            if x1 == x:
                return(True)
            else:
                return(False)
    

Log in to reply
 

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