摘要: All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to ... 阅读全文
posted @ 2015-08-02 23:33 ~每天进步一点点~ 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num... 阅读全文
posted @ 2015-08-02 23:06 ~每天进步一点点~ 阅读(167) 评论(0) 推荐(0) 编辑
摘要: The 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... 阅读全文
posted @ 2015-08-02 18:31 ~每天进步一点点~ 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文
posted @ 2015-08-02 18:04 ~每天进步一点点~ 阅读(96) 评论(0) 推荐(0) 编辑
摘要: Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.public class Solution { pu... 阅读全文
posted @ 2015-08-02 17:41 ~每天进步一点点~ 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A ... 阅读全文
posted @ 2015-08-02 17:33 ~每天进步一点点~ 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-08-02 17:06 ~每天进步一点点~ 阅读(85) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2015-08-02 16:57 ~每天进步一点点~ 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.If the fractional part is repeating,... 阅读全文
posted @ 2015-08-02 16:06 ~每天进步一点点~ 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1len2){ for(int i=len2;i0?1:-1; return 0; }} 阅读全文
posted @ 2015-08-02 15:22 ~每天进步一点点~ 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given 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 ... 阅读全文
posted @ 2015-08-02 12:30 ~每天进步一点点~ 阅读(134) 评论(0) 推荐(0) 编辑
摘要: A peak element is an element that is greater than its neighbors.Given an input array wherenum[i] ≠ num[i+1], find a peak element and return its index.... 阅读全文
posted @ 2015-08-02 11:20 ~每天进步一点点~ 阅读(125) 评论(0) 推荐(0) 编辑