Practice ยท 2 of 5
Max value AND its position
Implement int[] maxWithIndex(int[] values) returning {max, index} of the FIRST occurrence of the largest value. Return new int[]{-1, -1} for an empty array.
Difficulty: beginner
Press Submit to check your solution.
Back to lesson: Practice: Practice: Loops