Find the max

Report a typo

Write a program that reads an array of integers and finds the index of the first maximum in the array.

The first line contains the number of elements in the array. The other lines contain the elements of the array. There is at least one element in the array.

Output a single integer value which is the index of the first maximum.

Sample Input 1:

5
2
5
3
4
5

Sample Output 1:

1

Sample Input 2:

6
1000
10
1000
10
10
1001

Sample Output 2:

5
Write a program in Kotlin
fun main() {
// write your code here
}
___

Create a free account to access the full topic