2014年1月13日

LeetCode: 3Sum & 4Sum

摘要: 就是在2Sum的基础上进行计算的。 阅读全文

posted @ 2014-01-13 10:48 longhorn 阅读(112) 评论(0) 推荐(0) 编辑

LeetCode: Generate Parentheses

摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"最开始想的是,先产生n-1的情况,然后在n-1中的每个string的前面,后面加上()以及用()扩住整个string。 阅读全文

posted @ 2014-01-13 10:10 longhorn 阅读(186) 评论(0) 推荐(0) 编辑

导航