diff --git a/problem_009/solution.py b/problem_009/solution.py new file mode 100644 index 0000000..2c4f936 --- /dev/null +++ b/problem_009/solution.py @@ -0,0 +1,8 @@ +class Solution: + def isPalindrome(self, x: int) -> bool: + number_str = str(x) + reverse_number_str = number_str[::-1] + if(number_str == reverse_number_str): + return True + else: + return False \ No newline at end of file diff --git a/problem_009/test_inputs.json b/problem_009/test_inputs.json new file mode 100644 index 0000000..78c5512 --- /dev/null +++ b/problem_009/test_inputs.json @@ -0,0 +1,17 @@ +{ + "method": "isPalindrome", + "tests": [ + { + "Input": "121", + "Output": "True" + }, + { + "Input": "-121", + "Output": "False" + }, + { + "Input": "10", + "Output": "False" + } + ] +} \ No newline at end of file