摘要: [抄题]: Example 2: Example 3: Example 4: Example 5: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: 根本不知道应该怎么处理越界啊: 先设置一个bound 阅读全文
posted @ 2018-07-28 21:47 苗妙苗 阅读(111) 评论(0) 推荐(0)
摘要: [抄题]: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set 阅读全文
posted @ 2018-07-28 20:56 苗妙苗 阅读(244) 评论(0) 推荐(0)
摘要: [抄题]: Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. word1 and word2 may be th 阅读全文
posted @ 2018-07-28 17:31 苗妙苗 阅读(158) 评论(0) 推荐(0)
摘要: [抄题]: Numbers can be regarded as product of its factors. For example, Write a function that takes an integer n and return all possible combinations of 阅读全文
posted @ 2018-07-28 15:37 苗妙苗 阅读(149) 评论(0) 推荐(0)
摘要: [抄题]: Given a binary tree, collect a tree's nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty. Example:Gi 阅读全文
posted @ 2018-07-28 14:44 苗妙苗 阅读(159) 评论(0) 推荐(0)
摘要: [抄题]: Design a max stack that supports push, pop, top, peekMax and popMax. Example 1: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case] 阅读全文
posted @ 2018-07-28 09:43 苗妙苗 阅读(527) 评论(0) 推荐(0)