
leetcode 算法
ayzmkk
一只程序媛
展开
-
[leetcode] 学习记录——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的问题,不要用算法的角度去考虑,因为考虑到测试用例肯定会有大数,因此int得到结果后在数0是原创 2015-01-22 14:58:45 · 686 阅读 · 1 评论 -
[leetcode] 学习记录——Compare Version Numbers
Compare two version numbers version1 and version1.If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.You may assume that the version strings are non-empty and co原创 2015-01-22 14:32:19 · 560 阅读 · 0 评论 -
[leetcode] 学习记录——Add Two Numbers
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *ad原创 2015-01-22 14:44:16 · 787 阅读 · 0 评论