题目描述:
Given a range [m, n] where 0
For example, given the range [5, 7], you should return 4.
代码:
class Solution
{
public:
int rangeBitwiseAnd(int m,int n)
{
int i = 0;
while(m ...
分类:
其他好文 时间:
2015-05-12 15:35:24
阅读次数:
107
AndTwo and two makes four. 2加2ComeYour family should always come before your job. 更重要BigHer husband was a big man. 身材高大的男子汉HelpHe can't help having bi...
分类:
其他好文 时间:
2015-05-12 15:10:56
阅读次数:
236
【题目】
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remai...
分类:
其他好文 时间:
2015-05-12 11:34:01
阅读次数:
92
Keep the Build CleanJohannes BrodwallHAVE YOU EVER LOOKED AT a list of compiler warnings the length of an essay on bad coding and thought to yourself, “You know, I really should do something about that...
分类:
其他好文 时间:
2015-05-12 11:22:03
阅读次数:
132
【题目】
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constan...
分类:
其他好文 时间:
2015-05-12 09:25:09
阅读次数:
114
1 Intro Every link is controlled by alinker script. The main purpose of the linker script is to describe how the sections in the input files should...
分类:
其他好文 时间:
2015-05-12 01:29:16
阅读次数:
79
题目描述
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it w...
分类:
其他好文 时间:
2015-05-11 22:12:08
阅读次数:
145
Problem:
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should r...
分类:
编程语言 时间:
2015-05-11 20:07:26
阅读次数:
145
Problem:
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only con...
分类:
编程语言 时间:
2015-05-11 18:04:39
阅读次数:
145
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree should look like:
1
...
分类:
其他好文 时间:
2015-05-11 14:54:35
阅读次数:
134