Skip to main content

Practice · 1 of 5

Longest with earliest tie

CHALLENGE
Difficulty: intermediate+25 XP

Implement String longest(String[] words): the earliest of the longest strings, null for empty input. One pass, strict comparison — think about which comparison operator keeps the earlier winner.

Back to lesson: Practice: Flow lab