Skip to main content

Practice · 5 of 5

Debug the removal

CHALLENGE
Difficulty: beginner+25 XP

removeAll should delete every occurrence of target, but some targets survive. Explain-why-then-fix: the forward loop skips shifted elements. Rewrite with a correct pattern.

Back to lesson: Practice: List practice