Skip to content

Instantly share code, notes, and snippets.

@JessicaGillan
Created November 28, 2016 15:55
Show Gist options
  • Save JessicaGillan/0de148158d522a8e35b2958b7318e348 to your computer and use it in GitHub Desktop.
Save JessicaGillan/0de148158d522a8e35b2958b7318e348 to your computer and use it in GitHub Desktop.
2015, Day 1
def floor_finder(input= "", floor = 0)
input.chars.each do |char|
if char == '('
floor += 1
elsif char == ')'
floor -= 1
end
end
floor
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment