题目链接https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/题目原文
Say you have an array for which the ithi^{th} element is the price of a given stock on day ii.
Design an algorithm to fi...
分类:
编程语言 时间:
2016-07-30 13:42:44
阅读次数:
181
题目链接https://leetcode.com/problems/single-number-iii/题目原文
Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two e...
分类:
编程语言 时间:
2016-07-30 12:14:59
阅读次数:
218
题目链接https://leetcode.com/problems/product-of-array-except-self/题目原文
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the eleme...
分类:
编程语言 时间:
2016-07-30 12:13:13
阅读次数:
210
题目链接https://leetcode.com/problems/single-number/题目原文
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear ru...
分类:
编程语言 时间:
2016-07-29 15:36:50
阅读次数:
183
题目链接https://leetcode.com/problems/counting-bits/题目原文
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation a...
分类:
编程语言 时间:
2016-07-29 15:36:46
阅读次数:
210
题目链接https://leetcode.com/problems/word-pattern/题目原文
Given a pattern and a string str, find if str follows the same pattern.
Here follow means a full match, such that there is a bijection between...
分类:
编程语言 时间:
2016-06-21 08:03:38
阅读次数:
178
题目链接
https://leetcode.com/problems/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"...
分类:
编程语言 时间:
2016-06-21 07:47:43
阅读次数:
204
题目链接https://leetcode.com/problems/length-of-last-word/题目原文
Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string.
I...
分类:
编程语言 时间:
2016-06-21 07:42:27
阅读次数:
167
题目链接
https://leetcode.com/problems/add-binary/
题目原文
题目翻译
思路方法
思路一
代码
说明
思路二
代码
说明
思路三
代码
说明
PS: 新手刷LeetCode,新手写博客,写错了或者写的不清楚还请帮忙指出,谢谢!
转载请注明:...
分类:
编程语言 时间:
2016-06-21 07:30:27
阅读次数:
151
题目链接https://leetcode.com/problems/reverse-bits/题目原文
Reverse bits of a given 32 bits unsigned integer.
For example, given input 43261596 (represented in binary as 00000010100101000001111010011100...
分类:
编程语言 时间:
2016-06-21 07:29:03
阅读次数:
439