Guide to Leetcoding
Approach Try to solve the problem using brute force. This helps to come up with a logic required for the problem. Identify the pattern. Implement the solution using the pattern. Identify time and space complexity. Tips to match the pattern If the problem involves exploring a search space in a tree or a graph then we can consider BFS or DFS. If the problem requires minimum number of steps then we should use BFS instead of DFS to explore....