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.

  1. Keep track of the highestValue and the highestIndex.
  2. Print the highestIndex after scanning the entire list.

01EXAMPLE 1

Input[10, 50, 20]
Output1

Explanation: 50 is at index 1.

Constraints

  • If there is a tie, print the FIRST index found.
ArraysLoops
JavaScript
Loading...
2 Hidden

Input Arguments

dataset[10,50,20]

Expected Output

1

Click RUN to test your solution