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 walls = [ 2, 5, 1, 2, 3, 4, 7, 7, 6 ] | |
println(calculateVolume(walls)) | |
assert 10 == calculateVolume(walls) | |
def calculateVolume(land) { | |
def leftMax = 0 | |
def rightMax = 0 | |
def left = 0 |