Buttons generator (with DFS) and a reverse_sorting decorator solution in Clear category for The Buttons by Phil15
reverse_sorting = lambda f: lambda *args: sorted(f(*args), reverse=True)
@reverse_sorting # It's a trivial thing to do that a decorator can do for us.
def buttons(ceiling): # Buttons generator
ceiling = [[int(k) for k in row] for row in ceiling.strip().splitlines()]
nb_rows, nb_cols = len(ceiling), len(ceiling)
neighbors = lambda i, j: ((i+I,j+J) for I, J in ((-1,0),(1,0),(0,-1),(0,1))
Sept. 23, 2018