LeetCode --- 174. Dungeon Game Apr 26, 2015

 Tags LeetCode , C++ , 动态规划 , 二分搜索

题目链接:Dungeon GameThe demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a... More »

0条评论

LeetCode --- 173. Binary Search Tree Iterator Apr 25, 2015

 Tags LeetCode , C++ , ,

题目链接:Binary Search Tree IteratorImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() wil... More »

0条评论

LeetCode --- 172. Factorial Trailing Zeroes Apr 24, 2015

 Tags LeetCode , C++ , 数学

题目链接:Factorial Trailing ZeroesGiven an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.这道题的要求是统计n!(n... More »

0条评论

LeetCode --- 171. Excel Sheet Column Number Apr 24, 2015

 Tags LeetCode , C++ , 数学

题目链接:Excel Sheet Column NumberRelated to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For ... More »

0条评论

LeetCode --- 169. Majority Element Apr 23, 2015

 Tags LeetCode , C++ , 分治 , 数组 , 位操作

题目链接:Majority ElementGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that ... More »

0条评论

LeetCode --- 168. Excel Sheet Column Title Apr 23, 2015

 Tags LeetCode , C++ , 数学

题目链接:Excel Sheet Column TitleGiven a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -&... More »

0条评论

LeetCode --- 166. Fraction to Recurring Decimal Apr 22, 2015

 Tags LeetCode , C++ , Hash表 , 数学

题目链接:Fraction to Recurring DecimalGiven two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional p... More »

0条评论

LeetCode --- 165. Compare Version Numbers Apr 21, 2015

 Tags LeetCode , C++ , 字符串

题目链接:Compare Version NumbersCompare two version numbers version1 and version2.If version1 > version2 return 1, if version1 < version2 return -1, otherwise return... More »

0条评论

LeetCode --- 164. Maximum Gap Apr 21, 2015

 Tags LeetCode , C++ , 排序

题目链接:Maximum GapGiven an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 i... More »

0条评论

LeetCode --- 162. Find Peak Element Apr 20, 2015

 Tags LeetCode , C++ , 数组 , 二分搜索

题目链接:Find Peak ElementA peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its ... More »

0条评论