2015年1月28日

[leetcode] Jump Game II

摘要: Jump Game IIGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents... 阅读全文

posted @ 2015-01-28 10:59 cha1992 阅读(127) 评论(0) 推荐(0) 编辑

2015年1月22日

[leetcode] Reverse Nodes in k-Group

摘要: Reverse Nodes in k-GroupGiven a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a... 阅读全文

posted @ 2015-01-22 22:56 cha1992 阅读(132) 评论(0) 推荐(0) 编辑

2015年1月20日

[leetcode] Distinct Subsequences

摘要: Distinct SubsequencesGiven a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is... 阅读全文

posted @ 2015-01-20 13:12 cha1992 阅读(117) 评论(0) 推荐(0) 编辑

[leetcode] Count and Say

摘要: Count and SayThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is r... 阅读全文

posted @ 2015-01-20 10:41 cha1992 阅读(132) 评论(0) 推荐(0) 编辑

2015年1月19日

[leetcode] Edit Distance

摘要: Edit DistanceGiven two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You... 阅读全文

posted @ 2015-01-19 11:14 cha1992 阅读(104) 评论(0) 推荐(0) 编辑

2015年1月18日

[leetcode] Gas Station

摘要: Gas StationThere areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it... 阅读全文

posted @ 2015-01-18 19:46 cha1992 阅读(156) 评论(0) 推荐(0) 编辑

2015年1月16日

[leetcode] Palindrome Partitioning

摘要: Palindrome PartitioningGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioni... 阅读全文

posted @ 2015-01-16 12:11 cha1992 阅读(149) 评论(0) 推荐(0) 编辑

2015年1月15日

[leetcode] Factorial Trailing Zeroes

摘要: Factorial Trailing ZeroesGiven an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.思路:不... 阅读全文

posted @ 2015-01-15 15:22 cha1992 阅读(98) 评论(0) 推荐(0) 编辑

[leetcode] Binary Search Tree Iterator

摘要: Binary Search Tree IteratorImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callin... 阅读全文

posted @ 2015-01-15 14:15 cha1992 阅读(102) 评论(0) 推荐(0) 编辑

2015年1月14日

[leetcode] Reverse Linked List II

摘要: Reverse Linked List IIReverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return... 阅读全文

posted @ 2015-01-14 10:38 cha1992 阅读(88) 评论(0) 推荐(0) 编辑

导航