Leetcode Pattern 1 | BFS + DFS == 25% of the problems — part 1
It is amazing how many graph, tree and string problems simply boil down to a DFS (Depth-first search) / BFS (Breadth-first search). Today we are going to explore this basic pattern in a novel way and apply the intuition…