Skip to content

Instantly share code, notes, and snippets.

def max_to_left(elevations):
max_so_far = float(inf) * -1
maxes_to_left = []
for h in elevations:
if h > max_so_far:
max_so_far = h
maxes_to_left.append(max_so_far)
return maxes_to_left
def max_to_right(elevations):