Balanced Binary Tree

Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.

Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory.

Remove Duplicates from Sorted Array II

Given a sorted array, remove the duplicates in place such that each element appear only at most twice and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory.

Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

Unique Paths In A Grid

A robot is located at the top-left corner of a m x n grid. The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid. How many possible unique paths are there?

Unique Paths In A Grid With Obstacles

A robot is located at the top-left corner of a m x n grid and trying to reach the bottom-right corner. The grid consists of open spots that are marked with 0, and obstables that are marked with 1. The robot can only move through open spots and either down or right at any point in time. How many possible unique paths are there?

Subarray Sum of Zero

Given an integer array, find a subarray where the sum of numbers is zero. Your code should return the index of the first number and the index of the last number.

Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once.

Minimum Path Sum in a Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.

Minimum Path Sum in a Grid

Given a m x n grid filled with non-negative numbers, and only allowing to move either down or right, find a path from top left to bottom right which minimizes the sum of all numbers along its path.