-
Notifications
You must be signed in to change notification settings - Fork 382
Closed
Description
LeetCode Username
amjadkhhan
Problem Number, Title, and Link
- Palindrome Number https://leetcode.com/problems/palindrome-number/
Bug Category
Problem hints, Problem constraints, Incorrect test case (Output of test case is incorrect as per the problem statement)
Bug Description
The output was always false for positive number
Language Used for Code
Python/Python3
Code used for Submit/Run operation
class Solution:
def isPalindrome(self, x: int) -> bool:
if x < 0 or (x % 10 == 0 and x !=0):
return False
rev=0
temp=x
while (x!=0):
digit=x%10
rev=rev*10+digit
x=x//10
return temp==revExpected behavior
Was not getting an expected answer
Screenshots
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels