Practice ยท 2 of 5
Count adjacent repeats in a list
CHALLENGE
Difficulty: intermediate+25 XP
Count the positions i (from the second element on) where the element **equals its predecessor**. Use .equals โ these are Integer objects.
Example: [1,1,2,2,2,3] โ 3.
Press Submit to check your solution.
Back to lesson: Practice: Method mastery gauntlet