[ 问题: ]
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
If the last word does not exist, return 0.
[...
分类:
其他好文 时间:
2014-07-22 23:01:35
阅读次数:
331
[ 问题: ]
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were
inserted in order. You may assume no duplicates in th...
分类:
其他好文 时间:
2014-07-22 23:01:15
阅读次数:
270
函数闭包
function createCountdownTimer(second)
local ms=second * 1000;
local function countDown()
ms = ms - 1;
return ms;
end
return countDown;
end
timer1 = createCountdownTimer(1);
for...
分类:
其他好文 时间:
2014-07-22 22:59:53
阅读次数:
307
Sliding Window
Time Limit: 12000MS
Memory Limit: 65536K
Total Submissions: 36212
Accepted: 10723
Case Time Limit: 5000MS
Description
An array of size n ≤ 106 is gi...
一次性通过的,比较顺利,从读题到编写到检查到通过,14分50秒,我在不断进步中,相信经过一段时间联系,这种题可以一眼就写出来,不超过5分钟。这道题应该说方法跟
Remove Duplicates from sorted Array挺类似的My Solution: 1 public class Sol...
分类:
其他好文 时间:
2014-05-02 12:56:10
阅读次数:
260
看一小段C语言程序:int main(){ float x = 1.3; x = x -
(int)x; int i = (int)(x*10); return 0;}在你心目中, 变量 I 是怎样的结果?如果你理所当然地认为是3的话,
那么你就错了~~~实际结果应该是2. ...
分类:
编程语言 时间:
2014-05-02 09:23:52
阅读次数:
288
在Controller中: public ActionResult LoadFoo() {
return PartialView("Foo", aModel); }Javascript: function loadFoo() { $.ajax({
url: "LoadFoo", success: f...
分类:
Web程序 时间:
2014-05-02 08:18:52
阅读次数:
353
函数指针
1. 函数与函数指针类型要匹配;
2. 函数指针用来保存函数首地址,即可以通过该指针访问函数;
3. 函数指针可以指向一类函数,而不是一个函数,即可以重新赋值。
int maxNumber(int a, int b)
{
return a > b? a: b;
}
void fileFunc(){ cout
void editFunc(){ ...
分类:
其他好文 时间:
2014-05-02 04:33:25
阅读次数:
276
join函数利用字符将数组中的元素分割开.[root@localhost~]#find`perl-e‘@array=join("","@INC");print"@array";‘`-name*.pm|wc-l547这个例子是利用空格分开了要查找的路径,然后find可以查找所有的路径下匹配*.pm的文件,我一共查到了547个模块.
分类:
系统相关 时间:
2014-05-02 04:13:56
阅读次数:
311
Say you have an array for which theithelement
is the price of a given stock on dayi.If you were only permitted to complete at
most one transaction (ie...
分类:
其他好文 时间:
2014-05-02 00:37:20
阅读次数:
349