Wiggle Sort

Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3]...

Convert Sorted List to Balanced Binary Search Tree

Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced binary search tree.

Graph Valid Tree

Given n nodes labeled from 0 to n - 1 and a list of undirected edges (as a pair of nodes), write a function to check whether these edges make up a valid tree. You can assume that no duplicate edges will appear in edges. Since all edges are undirected, [0, 1] is the same as [1, 0] and thus will not appear together in edges.

Word Search II

Given a matrix of lower case letters and a dictionary, find all words in the dictionary that can be found in the matrix. A word can start from any position in the matrix and go left, right, up or down to an adjacent position.

Word Search

Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.

Flatten List

Given a list, each element in the list can be a list or integer. flatten it into a simply list with integers.

Sort Colors

Given an array with n objects colored, red, white or blue, represented by 0, 1, and 2 respectively, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.

Rotate Image

You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise)

Restore IP Addresses

Given a string containing only digits, restore it by returning all possible valid IP address combinations. Order of the result does not matter.

Pow(x, n)

Implement pow(x, n).