Skip to main content

Checkpoint: recursive count

Challenge on lesson: Checkpoint: recursive count

CHALLENGE
Difficulty: beginner+25 XP

Implement int countChar(String s, char c, int i) recursively: occurrences of c in s from index i onward. Empty remainder โ†’ 0; s.charAt(i) == c adds 1.

Back to lesson: Checkpoint: recursive count