上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页
摘要: 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-07-07 09:10 lilixu 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of two.所有为power of two的整数均为 100000... 的形式,减一则会造成所有位相异,即与的结果为0。这里需要排除当n为0的情况,减一后与的结果仍为... 阅读全文
posted @ 2015-07-06 16:31 lilixu 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.如果左边字母的值小于右边,则减去左边的,防止溢出,最后一个值一定需要加上去def rom... 阅读全文
posted @ 2015-07-05 19:54 lilixu 阅读(107) 评论(0) 推荐(0) 编辑
摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number... 阅读全文
posted @ 2015-07-04 15:49 lilixu 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.在一个字符串中查找另外一个字符串是否存在。暴力 O(... 阅读全文
posted @ 2015-07-04 09:22 lilixu 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2,1,... 阅读全文
posted @ 2015-07-03 09:15 lilixu 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2015-07-03 09:06 lilixu 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2015-07-02 15:20 lilixu 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文
posted @ 2015-07-02 14:23 lilixu 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Source:https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20&%20closures/ch1.mdCommon Compliation StepsTokenizing/Lexing:breaking up a strin... 阅读全文
posted @ 2015-07-02 11:19 lilixu 阅读(242) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页