原创 [LeetCode252]Meeting Rooms

Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), determi

原创 [LeetCode253]Meeting Rooms II

Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find th

原创 [LeetCode267]Palindrome Permutation II

Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no pa

原创 [LeetCode254]Factor Combinations

Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a function that ta

原创 [LeetCode255]Verify Preorder Sequence in Binary Search Tree

Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary search tree. Y

原创 [LeetCode261] Graph Valid Tree

Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a functi

原创 [LeetCode271]Encode and Decode Strings

Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and i

原创 [LeetCode280] Wiggle Sort

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

原创 [LeetCode270]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.

原创 [LeetCode265]Paint House II

There are a row of n houses, each house can be painted with one of the k colors. The cost of painting each house wi

原创 [LeetCode256]Paint House

There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost o

原创 [LeetCode277]Find the Celebrity

Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one celebrity. T

原创 [LeetCode259]3Sum Smaller

Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 <= i < j < k < n t

原创 [LeetCode282]Closest Binary Search Tree Value II

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

原创 [LeetCode276]Paint Fence

There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts