Leetcode – 79. Word Search

In this problem, we are given a two dimensional board of characters and we have to check if the word can be found in the board by checking adjacent cells only. A basic strategy to solve this problem would be to start walking down the board until the first character is found. Once the first character is found, look at …

Mohit AthwaniLeetcode – 79. Word Search

Leetcode – 863. All Nodes Distance K In Binary Tree

When I first saw this problem, I panicked! I knew that this some how had to be a Breadth First Search problem because BFS from any node gives you the shortest path to every other node that is connected to the tree. Since every node is represented as a TreeNode with only left and right pointers, I would need to …

Mohit AthwaniLeetcode – 863. All Nodes Distance K In Binary Tree