2013年8月20日

摘要: Add Two NumbersYou 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 linked list.Input:(2 -> 4 -> 3) + (5 -> 6 -> 4)Output:7 -> 0 -> 8破题,就是困 阅读全文
posted @ 2013-08-20 23:35 似溦若岚 阅读(126) 评论(0) 推荐(0) 编辑
摘要: String to Integer (atoi)Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.Notes:It is intended for this problem to be specified vaguely (ie, no given inp 阅读全文
posted @ 2013-08-20 23:33 似溦若岚 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Generate ParenthesesGivennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"历遍呢…… 1 class Solution { 2 public: 3 ve 阅读全文
posted @ 2013-08-20 09:04 似溦若岚 阅读(125) 评论(0) 推荐(0) 编辑

导航