LeetCode --- 135. Candy Mar 30, 2015

 Tags LeetCode , C++ , 贪心

题目链接:CandyThere are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requiremen... More »

0条评论

LeetCode --- 134. Gas Station Mar 29, 2015

 Tags LeetCode , C++ , 贪心

题目链接:Gas StationThere are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs ... More »

0条评论

LeetCode --- 133. Clone Graph Mar 28, 2015

 Tags LeetCode , C++ , 深度优先搜索 , 广度优先搜索 ,

题目链接:Clone GraphClone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ’s undirected graph serialization:Nodes are labeled un... More »

0条评论

LeetCode --- 131. Palindrome Partitioning Mar 27, 2015

 Tags LeetCode , C++ , 回溯

题目链接:Palindrome PartitioningGiven a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.F... More »

0条评论

LeetCode --- 130. Surrounded Regions Mar 26, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Surrounded RegionsGiven a 2D board containing ‘X’ and ‘O’, capture all regions surrounded by ‘X’.A region is captured by flipping all ‘O’s into ‘X’s in that surro... More »

0条评论

LeetCode --- 129. Sum Root to Leaf Numbers Mar 26, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Sum Root to Leaf NumbersGiven a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1... More »

0条评论

LeetCode --- 128. Longest Consecutive Sequence Mar 25, 2015

 Tags LeetCode , C++ , 数组

题目链接:Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3... More »

0条评论

LeetCode --- 127. Word Ladder Mar 24, 2015

 Tags LeetCode , C++ , 广度优先搜索

题目链接:Word LadderGiven two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: Only one letter c... More »

0条评论

LeetCode --- 125. Valid Palindrome Mar 23, 2015

 Tags LeetCode , C++ , 双指针 , 字符串

题目链接:Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,“A man, a plan, a canal: ... More »

0条评论

LeetCode --- 124. Binary Tree Maximum Path Sum Mar 23, 2015

 Tags LeetCode , C++ , , 深度优先搜索

题目链接:Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary t... More »

0条评论