Practice · 2 of 5
Index of the maximum
CHALLENGE
Difficulty: beginner+25 XP
Implement int maxIndex(int[] arr): the *position* of the largest element (first one if tied; arr is non-empty). Track the best index, not just the best value.
Press Submit to check your solution.
Back to lesson: Practice: Array reps