Skip to content

start / end [terminology]

Terminology

Usage

  • Use for meaningful boundaries of an interval, substring, slice, or run.
  • Prefer them when the boundaries describe a region rather than active left and right pointers.
  • They are clearer when stored, returned, or used during backtracking.
for end in range(start, n):
    if is_palindrome[start][end]:
        cur.append(s[start:end + 1])