breath-first-search
elegant bfs using list comprehension, also can be used in tree traverse (row by row)
bfs = [target]
visited = set(bfs)
for i in range(K):
bfs = [y for x in bfs for y in links[x] if y not in visited]
visited |= set(bfs)
binary matrix, find number of islands
bfs/dfs, keep visited
binary matrix, find 0s that are surrounded by all 1s
bfs start from boundaries, if 0 are connected to boundaries, set it to 2
dfs
adsgsdgdfg