Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Stone Wall by H4stoor
def stone_wall(wall):
wall = wall.strip().split('\n')
return sorted(
[(''.join([col[i] for col in wall]).replace('0', ''), i) for i in range(len(wall[0]))]
)[0][1]
if __name__ == '__main__':
print("Example:")
print(stone_wall('''
##########
#0##0##0##
00##0###00
'''))
#These "asserts" using only for self-checking and not necessary for auto-testing
assert stone_wall('''
##########
####0##0##
00##0###00
''') == 4
assert stone_wall('''
#00#######
#######0##
00######00
''') == 1
assert stone_wall('''
#####
#####
#####
''') == 0
assert stone_wall('''
#####
##000
#####
''') == 2
print("Coding complete? Click 'Check' to earn cool rewards!")
Sept. 8, 2018