MO.AT

# What I've been up to

Ramblings and teachings on topics of interest to me.

## Leetcode - 212. Word Search II

Algorithms, Backtracking, Trie

###### Problem Statement

Given a 2D board and a list of words from the dictionary, find all words in the board.

## Leetcode - 79. Word Search

Algorithms, Array, Backtracking, Depth First Search

###### Problem Statement

Given a 2D board and a word, find if the word exists in the grid.

## Leetcode - 863. All Nodes Distance K In Binary Tree

Algorithms, Binary Tree, Breadth First Search, Depth First Search

###### Problem Statement

Given the `root` node of a Binary Tree, a `target` node and a distance `k`, return a list of all nodes that are a distance `k` from the `target`.

## Leetcode - 33. Search In Rotated Sorted Array

Algorithms, Array, Binary Search

This is straight up Binary Search problem with some modifications. When we find the mid point of the given array, one of two things will hold true:

## Leetcode - 42. Trapping Rain Water

Algorithms, Array, Recursion, Two Pointers, Leetcode

There’s one thing common between this problem and the Container With Most Water problem and that is the height of the shorter tower dictates the result. In this problem, the amount of water that can accumulate between two towers is limited by the height of the shorter tower. Consider an array [4, 5, 9, 7 ,1, 0 ,4, 0 ,8 ,6 ,5 ,2 ,3] which is represented as:

## Generate Parantheses

Algorithms, Backtracking, Recursion, String, Leetcode

Before we start solving this problem, let’s do some math first. The problem statement clearly states that we have N pairs of parentheses to work with. That means for a string to be considered as part of the solution, it must be of size 2N.