Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update palindrome.py
  • Loading branch information
MaximSmolskiy authored Sep 4, 2025
commit c82d6b3934101e4506ac0c6044ca1d52f98b576d
2 changes: 1 addition & 1 deletion strings/palindrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def is_palindrome_recursive(s: str) -> bool:
>>> all(is_palindrome_recursive(key) is value for key, value in test_data.items())
True
"""
if len(s) <= 2:
if len(s) <= 1:
return True
if s[0] == s[len(s) - 1]:
return is_palindrome_recursive(s[1:-1])
Expand Down