Given a range [m, n] where 0
For example, given the range [5, 7], you should return 4.
这题如果按照题意做会超时,用移位的操作很妙,因为是并操作,其实只要最小的数和最大的数从左往右取相同的位即可。遇到不同就退出,因为他们中间肯定有数该为为0。
class Solution {
public:
...
分类:
其他好文 时间:
2015-05-09 06:35:16
阅读次数:
109
编辑配置文件/etc/httpd/conf.modules.d/00-mpm.conf#Select the MPM module which should be used by uncommenting exactly one of the following LoadModule line:默认...
分类:
Web程序 时间:
2015-05-08 23:40:54
阅读次数:
420
2 SumDescription:Given an array of integers, find two numbers such that they add up to a special target number.The function twoSum should return indic...
分类:
其他好文 时间:
2015-05-08 21:58:17
阅读次数:
102
ls Variable:NameValueDescription$?TRUEStatus of last command^argsSystem.Object[]ConfirmPreferenceHighDictates when confirmation should be requested. C...
分类:
系统相关 时间:
2015-05-08 19:59:49
阅读次数:
199
Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi...
分类:
其他好文 时间:
2015-05-08 19:53:40
阅读次数:
112
【题目】
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
【分析】
不要忘记先判断两个链表是否有空链表。其余的使用递归和非递归...
分类:
其他好文 时间:
2015-05-08 14:58:11
阅读次数:
97
题目描述:
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it withou...
分类:
其他好文 时间:
2015-05-08 13:09:35
阅读次数:
112
Problem:
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the e...
分类:
编程语言 时间:
2015-05-07 22:08:33
阅读次数:
331
The first thing that I must clear up is: the model is a layer.Second: there is a difference between classical MVC and what we use in web development. ...
分类:
Web程序 时间:
2015-05-07 10:21:13
阅读次数:
135
Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complex...
分类:
其他好文 时间:
2015-05-06 22:35:31
阅读次数:
152