The index of the maximum of a sequence

The index of the maximum of a sequence. A sequence consists of integer numbers and ends with the number 0. Determine the index of the largest element in the sequence. If the largest element is not unique, print the index of the first occurrence.

Test Case Input (Sequence) Expected Output
1 1
2
3
0
2
2 4
0
1
2
0
3 7
3
7
0
0