Skip to content

Commit 33036fe

Browse files
Fix: is_palindrome_recursive logic for 2-char strings
1 parent 0876a87 commit 33036fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

strings/palindrome.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def is_palindrome_recursive(s: str) -> bool:
6161
>>> all(is_palindrome_recursive(key) is value for key, value in test_data.items())
6262
True
6363
"""
64-
if len(s) <= 2:
64+
if len(s) <= 1:
6565
return True
6666
if s[0] == s[len(s) - 1]:
6767
return is_palindrome_recursive(s[1:-1])

0 commit comments

Comments
 (0)