Skip to main content

Practice · 2 of 5

Recursive palindrome

CHALLENGE
Difficulty: beginner+25 XP

Implement boolean isPal(String s, int lo, int hi) recursively: true when s[lo..hi] reads the same both ways. Base case lo >= hi is true; mismatched ends are false; otherwise recurse inward.

Back to lesson: Practice: Recursion reps