摘要: No.58 Length of Last WordGiven a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the st... 阅读全文
posted @ 2015-06-02 16:00 人生不酱油 阅读(153) 评论(0) 推荐(0) 编辑
摘要: No.6 ZigZag ConversionThe string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this patt... 阅读全文
posted @ 2015-06-02 15:23 人生不酱油 阅读(146) 评论(0) 推荐(0) 编辑
摘要: No.67 Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100". 与No.2 Add Two Numbers的思路非常相似,... 阅读全文
posted @ 2015-06-01 17:15 人生不酱油 阅读(136) 评论(0) 推荐(0) 编辑
摘要: No.2 Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nod... 阅读全文
posted @ 2015-06-01 16:36 人生不酱油 阅读(175) 评论(0) 推荐(0) 编辑
摘要: No.165 Compare Version NumbersCompare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1 version2 return 1, if version1 d... 阅读全文
posted @ 2015-06-01 14:59 人生不酱油 阅读(116) 评论(0) 推荐(0) 编辑
摘要: No.68 Text JustificationGiven an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right... 阅读全文
posted @ 2015-05-29 20:35 人生不酱油 阅读(172) 评论(0) 推荐(0) 编辑
摘要: No.29 Divide Two IntegersDivide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.Tags:MathBinary... 阅读全文
posted @ 2015-05-29 15:00 人生不酱油 阅读(144) 评论(0) 推荐(0) 编辑
摘要: No.7 Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321反转数字:将对10整除和取余的结果逆置即可难点即细节:溢出。符号疑问:溢出的,怎么处理... 阅读全文
posted @ 2015-05-28 21:05 人生不酱油 阅读(167) 评论(0) 推荐(0) 编辑
摘要: No.166 Fraction to Recurring DecimalGiven two integers representing the numerator and denominator of a fraction, return the fraction in string format.... 阅读全文
posted @ 2015-05-28 16:41 人生不酱油 阅读(194) 评论(0) 推荐(0) 编辑
摘要: No.65 Valid NumberValidate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended fo... 阅读全文
posted @ 2015-05-28 14:09 人生不酱油 阅读(140) 评论(0) 推荐(0) 编辑