021.Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.

Read More

023.Merge K Sorted Lists

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

Read More

268.Missing Number

Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array.

For example,
Given nums = [0, 1, 3] return 2.

Note:
Your algorithm should run in linear runtime complexity. Could you implement it using only constant extra space complexity?

Read More

135.Candy

There are N children standing in a line. Each child is assigned a rating value.

Read More

211.Add and Search Word - Data Structure Design

Design a data structure that supports the following two operations:

Read More

208.Implement Trie (Prefix Tree)

Implement a trie with insert, search, and startsWith methods.

Read More

167.Two Sum II - Input Array Is Sorted

Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.

Read More

270.Closest Binary Search Tree Value

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

Read More

141.Linked List Cycle

Given a linked list, determine if it has a cycle in it.

Read More

056.Merge Intevals

Given a collection of intervals, merge all overlapping intervals.

Read More

137.Single Number II

Given an array of integers, every element appears three times except for one. Find that single one.

Read More

107.Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).

Read More

102.Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).

Read More

236.Lowest Common Ancestor of a Binary Tree

Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.

Read More

235.Lowest Common Ancestor of a Binary Search Tree

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.

Read More