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.