79809194

Date: 2025-11-04 17:13:47
Score: 1
Natty:
Report link

Here is my take if you want to avoid slicing the string at each level.


def palindrome(s, i=0, j=None):
  if j == None:
    j = len(s) - 1

  if i > j:
    return True
    
  return s[i] == s[j] and palindrome(s, i + 1, j - 1)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Anthony