
leetcode
dian张
在路上。。。
展开
-
Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linke原创 2016-05-16 23:43:19 · 271 阅读 · 0 评论 -
String to Integer (atoi)
字面意思直接翻译: 字符串转为数字:我一开始好简单呀,Java用一个函数就解决了的事情了。不过考虑细节很多。 leetcode规则如下: 1. 字串为空或者全是空格,返回0; 2. 字串的前缀空格需要忽略掉; 3. 忽略掉前缀空格后,遇到的第一个字符,如果是‘+’或‘-’号,继续往后读;如果是数字,则开始处理数字;如果不是前面的2种,返回0; 4. 处理数字的过程中,如果之后的字符非数原创 2016-08-19 21:59:40 · 384 阅读 · 0 评论 -
Two-Sum
原题 Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the targ原创 2018-01-25 11:27:10 · 175 阅读 · 0 评论