728x90
https://leetcode.com/problems/palindrome-number/
class Solution:
def isPalindrome(self, x: int) -> bool:
str_x = str(x)
max_index = len(str_x)
for i in range(0, max_index):
if str_x[i] == str_x[max_index - 1 - i]:
continue
else:
return False
return True
728x90
'IT > 코딩테스트' 카테고리의 다른 글
[Leetcode] 1002. Find Common Characters (0) | 2024.02.04 |
---|---|
[Leetcode] 2703. Return Length of Arguments Passed (0) | 2024.02.02 |
[Leetcode] 2859. Sum of Values at Indices With K Set Bits (0) | 2023.09.17 |
[Leetcode] 1141. User Activity for the Past 30 Days I (0) | 2023.09.06 |
[Leetcode] 1978. Employees Whose Manager Left the Company (0) | 2023.09.05 |