- 博客(10)
- 资源 (5)
- 收藏
- 关注
原创 leetcode-172-Factorial Trailing Zeroes
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连续有多少个。 例如 10!=10*
2015-08-31 19:25:09 504
原创 leetcode-258-Add Digits
Add Digits Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2.
2015-08-31 13:19:39 584
原创 leetcode-263-Ugly Number
Ugly Number Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly
2015-08-24 09:47:40 596
原创 leetcode-118-Pascal's Triangle
Pascal's Triangle Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1
2015-08-23 19:05:55 545
原创 leetcode-155-Min Stack
Min Stack Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack.pop() -- Removes the element on top of t
2015-08-04 18:14:58 570
原创 leetcode-67-Add Binary
Add Binary Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 两字符串表示的2进制数。求它们的和。 直接模拟,从最后一位开始每一位都相加,结果保存在栈中。 class Solut
2015-08-03 18:41:59 522
原创 leetcode-225-Implement Stack using Queues
Implement Stack using Queues Implement the following operations of a stack using queues. push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() --
2015-08-03 17:44:43 548
原创 leetcode-232-Implement Queue using Stacks
Implement Queue using Stacks Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.pe
2015-08-03 17:29:45 372
原创 leetcode-190-Reverse Bits
Reverse Bits Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represen
2015-08-01 22:34:58 502
原创 leetcode-242-Valid Anagram
Valid Anagram Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = "anagram", t = "nagaram", return true. s = "rat", t = "car", return f
2015-08-01 21:27:47 725
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人