摘要: Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100"class Solution {public: string addBinary(stri... 阅读全文
posted @ 2014-07-09 13:43 Hicandyman 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.思路:递归。主要是注意调用时起... 阅读全文
posted @ 2014-07-09 13:27 Hicandyman 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega... 阅读全文
posted @ 2014-07-09 03:49 Hicandyman 阅读(141) 评论(0) 推荐(0) 编辑
摘要: GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]... 阅读全文
posted @ 2014-07-09 02:09 Hicandyman 阅读(147) 评论(0) 推荐(0) 编辑