Created
July 17, 2019 17:00
-
-
Save duane/3ae51f2da6c098c3a7007d7c71c691c9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Prints out a tree like this (branches_height = 5) with a pedestal: | |
# | |
# x | |
# xxx | |
# xxxxx | |
# xxxxxxx | |
# xxxxxxxxx | |
# | | |
# === | |
def render_tree(branches_height) | |
raise "branches_height must be at least 2" if branches_height < 2 | |
raise NotImplmentedError | |
end | |
# Looks for parens in the string, '(' for opening and ')' for closing. | |
# Return true if every opening paren is eventually followed by a matching closing paren, | |
# and every closing paren is following a matching opening paren. | |
# It should ignore all other characters. | |
def balanced(string) | |
raise NotImplmentedError | |
end | |
# Casees to test: | |
# () | |
# ) | |
# (())) | |
# ()(() | |
# ()((()(()))()) | |
# (hello, (some) more text (to complicate the process)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment