![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
ColorlessSilver
这个作者很懒,什么都没留下…
展开
-
Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Panama" is a palindrome."race a car" is not a原创 2015-05-10 17:11:37 · 360 阅读 · 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,可以想到要在末尾产生0,就必须有10才行,10=5*2,在阶乘中不缺2,那么这个问题就变成了在这原创 2015-05-06 17:15:47 · 388 阅读 · 0 评论 -
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 solutions as you原创 2015-05-06 17:03:08 · 327 阅读 · 0 评论 -
House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house原创 2015-05-06 16:53:23 · 279 阅读 · 0 评论 -
Happy Number
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares原创 2015-05-06 16:48:52 · 431 阅读 · 0 评论 -
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 al原创 2015-05-06 18:22:52 · 330 阅读 · 0 评论 -
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 ->原创 2015-05-06 17:27:07 · 457 阅读 · 0 评论 -
Reverse Bits
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 001110010原创 2015-05-06 16:59:10 · 426 阅读 · 0 评论 -
Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representation 00000000原创 2015-05-06 16:59:25 · 367 阅读 · 0 评论 -
Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the l原创 2015-05-05 21:51:24 · 468 阅读 · 0 评论 -
Count and Say
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as "one原创 2015-05-05 20:55:52 · 479 阅读 · 0 评论 -
Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A2 -> B3 -> C...26 -> Z27 -> AA28 -> AB 思路:依旧是进制转换类型的,由于不是从0开始的 我原创 2015-05-07 11:31:03 · 386 阅读 · 0 评论