Created
November 28, 2016 15:55
-
-
Save JessicaGillan/0de148158d522a8e35b2958b7318e348 to your computer and use it in GitHub Desktop.
2015, Day 1
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 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