Last index of max

Report a typo

In the topic, you were given an algorithm that finds the first index of the maximum element in a list of numbers. Your task here is to modify that algorithm so that it finds the last index of the maximum element.

The input and output examples below are there to give you the idea of the algorithm. You do NOT need to work with the input, call the function, or print anything!

Tip: You need to slightly modify the condition on which we update the index.

Sample Input 1:

8 11 15 15 15 12

Sample Output 1:

4
Write a program in Python 3
def last_indexof_max(numbers):
# write the modified algorithm here
___

Create a free account to access the full topic