Skip to content

Commit f752da2

Browse files
authored
Merge pull request #1395 from ivan1016017/september15
adding algo
2 parents 4c72a7d + 94bee56 commit f752da2

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from typing import List, Union, Collection, Mapping, Optional
2+
from abc import ABC, abstractmethod
3+
4+
class Solution:
5+
def isPalindrome(self, x: int) -> bool:
6+
7+
str_x = str(x)
8+
9+
return str_x == str_x[::-1]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import unittest
2+
from src.my_project.interviews.top_150_questions_round_19\
3+
.palindrome_number import Solution
4+
5+
class PalindromeNumberTestCase(unittest.TestCase):
6+
7+
def test_is_palindrome_number(self):
8+
solution = Solution()
9+
output = solution.isPalindrome(x=121)
10+
self.assertTrue(output)
11+
12+
def test_is_no_palindrome_number(self):
13+
solution = Solution()
14+
output = solution.isPalindrome(x=123)
15+
self.assertFalse(output)

0 commit comments

Comments
 (0)