
leetcode
a8814828
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[leetcode]C语言:189 Rotate Array
void rotate(int nums[], int n, int k) { int temp; int nums1[n]; for (int y=0;y<n;y++){ nums1[(y+k+n)%n]=nums[y+n%n]; } for (int i=0;i<n;i++){ nums[i]=nums1[i];}}原创 2015-03-16 17:44:26 · 414 阅读 · 0 评论 -
[leetcode]C语言:172 Factorial Trailing Zeroes
**Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity.**int trailingZeroes(int n) { int s=0; while ((n/5)!=0) {原创 2015-03-16 18:08:19 · 417 阅读 · 0 评论 -
[leetcode]C语言:171 Excel Sheet Column Number
Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example:A -> 1B -> 2C -> 3...Z -> 26AA -> 27AB -> 28 int原创 2015-03-21 20:05:40 · 446 阅读 · 0 评论 -
[leetcode]C语言:169 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 always原创 2015-03-21 20:08:48 · 443 阅读 · 0 评论