Skip to content

Instantly share code, notes, and snippets.

Fernando A fergara

  • Fergara Software
  • Brazil
Block or report user

Report or block fergara

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fergara
fergara / CalculateRainVolume.groovy
Last active Dec 27, 2015
Groovy version of the "Calculate Rain Volume" algorithm.
View CalculateRainVolume.groovy
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
You can’t perform that action at this time.