From 9cc6787695e9e90bdeb1bf738aeda518727686a8 Mon Sep 17 00:00:00 2001 From: Cal Barkman Date: Fri, 17 Oct 2025 18:27:15 -0700 Subject: [PATCH] Use proper template. --- problem_009/solution.py | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/problem_009/solution.py b/problem_009/solution.py index 2c4f936..24f5a91 100644 --- a/problem_009/solution.py +++ b/problem_009/solution.py @@ -1,8 +1,30 @@ -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 +# Extra header to ensure that tests can run individually and as a suite +# ------------------------------------------------------------------- +import sys +from pathlib import Path +# Add the project root folder to the Python path +sys.path.append(str(Path(__file__).resolve().parents[1])) +# ------------------------------------------------------------------- + +# Now you can import your wrapper +from test_runner.wrapper import run_tests + +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 + + +if __name__ == "__main__": + # Get the directory where this solution.py script lives + script_dir = Path(__file__).parent + + # Join the script's directory with the JSON filename to create a full path + # Make sure your file is actually named "test_inputs.json"! + test_file_path = script_dir / "test_inputs.json" + + run_tests(Solution, test_file_path) \ No newline at end of file