Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1-...
分类:
其他好文 时间:
2014-06-22 22:57:49
阅读次数:
347
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]
]
解题思路:
杨辉三角没什么好说的...
分类:
其他好文 时间:
2014-06-22 22:48:11
阅读次数:
305
服务类
中间人:service服务中的bind对象
创建中间人并通过onBinder方法的return暴露出去
在服务类创建一个服务
创建中间人继承Binder
MainActivity类
声明服务的中间人
private ServiceTese.MyBinder myBinder;
链接成功的时候赋值se...
分类:
其他好文 时间:
2014-06-22 21:36:21
阅读次数:
188
Given an index k, return the
kth row of the Pascal's triangle.
For example, given k = 3,
Return [1,3,3,1].
Note:
Could you optimize your algorithm to use only
O(k) extra space?
...
分类:
其他好文 时间:
2014-06-22 21:31:26
阅读次数:
214
//防止页面进行跳转
$(document).ready(function(){
$("#submit").click(function(){
var str_data=$("#form1 input[type=text]").map(function(){
return ($(this).attr("name")+'='+$(this).val());
})...
分类:
其他好文 时间:
2014-06-22 16:04:47
阅读次数:
200
// 函数写法初体验
func getMyName(firstName first:String, lastName last:String) -> String{
//return first + "-" + last
return first + last
}
var myName = getMyName(firstName: "hu", lastName: "mingta...
分类:
其他好文 时间:
2014-06-21 22:53:20
阅读次数:
211
python自带调试工具库:pdb
# -*- coding:utf-8 -*-
def func(num):
s = num * 10
return s
if __name__ == '__main__':
print 'debug starting...'
print '*' * 10
print ‘debug ending…’
num...
分类:
数据库 时间:
2014-06-21 20:55:59
阅读次数:
357
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
求数字字符串的二进制和。同之前的数组代表数字,两个数组相加一样,只不过进位变成了2.可能两个串的长度不一样,故逆转,从左到右加下去,最后再逆转。
publi...
分类:
其他好文 时间:
2014-06-21 20:11:21
阅读次数:
344
谜题36
finally语句中的return语句会覆盖掉try语句中的。
谜题37
该部分还需要进一步理解
一个方法可以抛出的被检查异常集合是它所适用的所有类型声明要抛出的被检查集合的交集。...
分类:
编程语言 时间:
2014-06-21 18:40:37
阅读次数:
194
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are som...
分类:
其他好文 时间:
2014-06-21 15:20:39
阅读次数:
191