Is there a way to change all the values past the max value of a list to its own? For example I have the given array arranged as followed:
values = [-10,-2,0,1,3,8,10,22,18,16,12,10]
where 22 is the max value of the list. I have the following pseudocode:
max_value = max(values)
for i in range(len(values)):
if values[i]== max_value:
values[i+1] = max_value
values[i +2] == max_value
...etc.
break
therefore:
values = [-10,-2,0,1,3,8,10,22,22,22,22,22]