$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · easy · #320

What goes in the blank?

# palindrome check with mirrored indexes
n = len(s)
for i in range(n // 2):
    if s[i] != s[n - 1 - ____]:
        return False
return True

Answer: i (also accepted: i)

Index i from the front is mirrored by n - 1 - i from the back.
Play Problem Solving ▸