yanginblack·Dec 12, 2015Permutation SequenceThe set [1,2,3,…,n] contains a total of n! unique permutations.
yanginblack·Dec 12, 2015Spiral Matrix IIGiven an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
yanginblack·Dec 12, 2015Length of Last WordGiven a string s consists of upper/lower-case alphabets and empty space characters ‘ ‘, return the length of last word in the string.
yanginblack·Dec 11, 2015Insert IntervalGiven a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
yanginblack·Dec 11, 2015Merge IntervalsGiven a collection of intervals, merge all overlapping intervals.
yanginblack·Dec 11, 2015Jump game Simple VersionGiven an array of non-negative integers, you are initially positioned at the first index of the array.
yanginblack·Dec 10, 2015Spiral MatrixGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
yanginblack·Dec 9, 2015MaximumFind the contiguous subarray within an array (containing at least one number) which has the largest sum.
yanginblack·Dec 9, 2015N-QueensGiven an integer n, return all distinct solutions to the n-queens puzzle.