![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 361 阅读 · 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 · 377 阅读 · 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 · 398 阅读 · 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 · 396 阅读 · 0 评论