This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |