179. Largest Number

Problem description:

Given a list of non negative integers, arrange them such that they form the largest number.

Readmore

406. Queue Reconstruction by Height

Problem description:

Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal to h. Write an algorithm to reconstruct the queue.

Readmore

341. Flatten Nested List Iterator

Problem description:

Given a nested list of integers, implement an iterator to flatten it.

Readmore

98. Validate Binary Search Tree

Problem description:

Given a binary tree, determine if it is a valid binary search tree (BST).

Readmore

150. Evaluate Reverse Polish Notation

Problem description:

Evaluate the value of an arithmetic expression in Reverse Polish Notation.

Readmore

STL container-Stack

Definition:
LIFO stack
Stacks are a type of container adaptor, specifically designed to operate in a LIFO context (last-in first-out), where elements are inserted and extracted only from one end of the container.

Readmore

241. Different Ways to Add Parentheses

Problem description:

Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.

1
2
3
4
5
6
7
Example 1:

Input: "2-1-1"
Output: [0, 2]
Explanation:
((2-1)-1) = 0
(2-(1-1)) = 2

Readmore

319. Bulb Switcher

Problem description:

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.

1
2
3
4
Example 1:

Input: [3,2,1,5,6,4] and k = 2
Output: 5

Readmore

8. String to Integer (atoi)

Problem description:

Implement atoi which converts a string to an integer.

Readmore

148. Sort List

Problem description:

Sort a linked list in O(n log n) time using constant space complexity.

1
2
3
4
Example 1:

Input: 4->2->1->3
Output: 1->2->3->4

Readmore