原创 leetcode第9題(linked-list-cycle-ii)

題目: Given a linked list, return the node where the cycle begins. If there

原创 leetcode第13題(copy-list-with-random-pointer)

題目: A linked list is given such that each node contains an additional ran

原创 leetcode第27題(binary-tree-maximum-path-sum)

題目: Given a binary tree, find the maximum path sum.  The path may start a

原创 leetcode第28題(best-time-to-buy-and-sell-stock-iii)

題目: Say you have an array for which the i th element is the price of a gi

原创 leetcode第12題(word-break)

題目: Given a string s and a dictionary of words dict, determine if s can b

原创 leetcode第16題(candy)

題目: There are N children standing in a line. Each child is assigned a rat

原创 leetcode第19題(palindrome-partitioning-ii)

題目:Given a string s, partition s such that every substring of the partition

原创 leetcode第14題(single-number-ii)

題目: Given an array of integers, every element appears three times except

原创 leetcode第23題(longest-consecutive-sequence)

題目: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.  For example,

原创 leetcode第29題(best-time-to-buy-and-sell-stock-ii)

題目: Say you have an array for which the i th element is the price of a gi

原创 surrounded-regions

題目: Given a 2D board containing'X'and'O', capture all regions surrounded b

原创 leetcode第22題(sum-root-to-leaf-numbers)

題目: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.  An example

原创 leetcode第11題(word-break-ii)

題目: Given a string s and a dictionary of words dict, add spaces in s to c

原创 leetcode第30題(best-time-to-buy-and-sell-stock)

題目: Say you have an array for which the i th element is the price of a given stock on day i.  If you were only permi

原创 leetcode第18題(clone-graph)

題目: Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.  OJ's undirected gra