Created
August 11, 2018 03:17
-
-
Save nathan-cruz77/9824ed30376fa020b2460032426531ca 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
# Return stirng representation of given array of building sizes (with overall height of 9) | |
# | |
# Sample usage: | |
# | |
# >>> print(buildings('252')) | |
# | |
# | |
# | |
# | |
# # | |
# # | |
# # | |
# ### | |
# ### | |
# | |
def buildings(ints): | |
heights = [int(i) for i in ints] | |
s = '' | |
for a in zip(*[('#' * int(i)).rjust(9) for i in heights]): | |
for i in a: | |
s += i | |
s += '\n' | |
return s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment