Practice · 4 of 5
Fix the run counter
CHALLENGE
Difficulty: intermediate+25 XP
runs returns 3 for "aabbbca" but the contract says 4. Trace the loop with a state table (i, charAt(i), count) and find the seeding error — the precondition allows the fix.
Press Submit to check your solution.
Back to lesson: Practice: String lab