Given a list of integers, find maximum value, number of maximum elements and index of last maximum in it.
so I'm trying to find the index of the last maximum, and I need to use sort, which doesn't preserve the order of the list, how do I fix this error?
a = [int(s) for s in input().split()]
a.sort()
if a.count(max(a)) == 1:
print(max(a), a.count(max(a)), a.index(max(a)))
else:
print(max(a), a.count(max(a)), len(a)-1)