- 博客(5)
- 收藏
- 关注
原创 leetcode Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA 28 -> AB 关键在于n是先
2015-03-06 13:01:08 345
原创 leetcode Majority Element
Given 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 the array is non-empty and the majority element
2015-03-04 21:18:14 337
原创 leetcode Excel Sheet Column Number
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 example: A -> 1
2015-03-04 20:24:38 398
原创 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!分解因子为...2^x 3^y 5^z .....但是对0有贡献的只有2和5,并且2的个数
2015-03-04 19:57:51 353
原创 leetcode Rotate Array
注意边界条件class Solution {public: void reverse(int nums[], int front, int end) { int last = end - 1; while (front < last) swap(nums[front++], nums[last--]);
2015-03-04 19:54:41 328
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人