272. Closest Binary Search Tree Value II

Problem description:

Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target.

Readmore

270. Closest Binary Search Tree Value

Problem description:

Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.

Readmore

304. Range Sum Query 2D - Immutable

Problem description:

Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2).

Readmore

160. Intersection of Two Linked Lists

Problem description:

Write a program to find the node at which the intersection of two singly linked lists begins.

Readmore

403. Frog Jump

Problem description:

A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.

Readmore

Flatten a multilevel linked list

Problem description:

Given a linked list where in addition to the next pointer, each node has a child pointer, which may or may not point to a separate list. These child lists may have one or more children of their own, and so on, to produce a multilevel data structure, as shown in below figure.You are given the head of the first level of the list.

Readmore

157. Read N Characters Given Read4

Problem description:

The API: int read4(char *buf) reads 4 characters at a time from a file.

Readmore

129. Sum Root to Leaf Numbers

Problem description:

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.

Readmore

30. Substring with Concatenation of All Words

Problem description:

You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and without any intervening characters.

Readmore

23. Merge k Sorted Lists

Problem description:

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.

Readmore