Peak Season
MediumAcc. 89.1%
+30 XP 12
Coordinate Search
Don't just find the highest value; find where it lives.
The Assignment
Your function receives an array dataset.
- Keep track of the
highestValueand thehighestIndex. - Print the
highestIndexafter scanning the entire list.
01EXAMPLE 1
Input
[10, 50, 20]Output
1Explanation: 50 is at index 1.
Constraints
- If there is a tie, print the FIRST index found.
ArraysLoops
JavaScriptSystem handles I/O — write your function only
Loading...
2 Hidden
Input Arguments
dataset[10,50,20]
Expected Output
1
Click RUN to test your solution