Skip to main content

Practice · 2 of 4

Fix: longest run counter

CHALLENGE
Difficulty: advanced+25 XP

The method should return the length of the **longest run of equal adjacent values**. Example failure: {1, 2, 2, 3, 3, 3, 1} returns 3 (correct) but {2, 2, 1, 1} returns 3 (wrong — should be 2). Find and fix the bug.

Back to lesson: Practice: Debug gauntlet: one bug each