
LeetCode
congduanxd
每天进步一点点
展开
-
【LeetCode】Factorial Trailing Zeroes 阶乘尾部0的个数
题目Factorial Trailing Zeroes Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity.题目大意 计算n阶乘中尾部0的个数,时间复杂度:O(logn)思路迭代的方原创 2015-04-23 15:53:00 · 1958 阅读 · 0 评论 -
【LeetCode】Rotate Array 旋转数组
题目 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Note: Try to come up as many solutio原创 2015-04-23 15:38:43 · 2597 阅读 · 0 评论 -
【LeetCode】LeetCode第一阶段50题小结
研二了,又到了找实习的时候。3年前大三的此时,实习面试回来,写了一篇痛定思痛的面试经历总结,现在翻看,依然历历在目。三年之间,自己也成长了不少,做了不少项目,也写了很多代码,但是仍然没有在数据结构与算法上下工夫。今年面试阿里巴巴实习生得以侥幸通过,面试官问到的题目还能正常应对,但是自己有一杆称知道自己的算法水平几斤几两。4月到9月,总共5个月,踏踏实实做点题,看点书,总是有好处的,至少在校招面试的时原创 2015-04-23 14:39:46 · 1791 阅读 · 1 评论 -
【LeetCode】Reverse Bits 翻转二进制
题目Reverse Bits Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented i原创 2015-04-23 14:59:36 · 1984 阅读 · 0 评论 -
【LeetCode】Unique Binary Search Trees 二叉查找树的个数
题目Unique Binary Search Trees Given n, how many structurally unique BST’s (binary search trees) that store values 1…n? For example, Given n = 3, there are a total of 5 unique BST’s. 题目大意原创 2015-04-24 13:20:40 · 2015 阅读 · 0 评论 -
【LeetCode】Word Break 单词拆分
题目Word Break Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For example, given s = “leetcod原创 2015-04-24 14:17:03 · 5288 阅读 · 0 评论