Practice · 5 of 6
Fix the sentinel stop
CHALLENGE
Difficulty: intermediate+25 XP
lastIndexOf must return the LAST occurrence's index but stops at the first. Trace {4, 7, 7} with key 7, then remove the guard that freezes the result.
Press Submit to check your solution.
Back to lesson: Practice: Array lab