Given an unsorted array
nums, reorder it in-place such that
nums <= nums >= nums <= nums...
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced binary search tree.
n nodes labeled from
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.
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.
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.
Given a list, each element in the list can be a list or integer. flatten it into a simply list with integers.
Given an array with
n objects colored,
blue, represented by
2 respectively, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
You are given an
n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise)
Given a string containing only digits, restore it by returning all possible valid IP address combinations. Order of the result does not matter.