上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 77 下一页
摘要: [抄题]: 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 苗妙苗 阅读(157) 评论(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)
摘要: [抄题]: You need to find the largest value in each row of a binary tree. Example: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问 阅读全文
posted @ 2018-07-27 22:24 苗妙苗 阅读(154) 评论(0) 推荐(0)
摘要: [抄题]: Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a lis 阅读全文
posted @ 2018-07-27 15:48 苗妙苗 阅读(236) 评论(0) 推荐(0)
摘要: [抄题]: Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip 阅读全文
posted @ 2018-07-27 12:18 苗妙苗 阅读(189) 评论(0) 推荐(0)
摘要: [抄题]: Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into knon-empty subsets whose sums are 阅读全文
posted @ 2018-07-27 10:11 苗妙苗 阅读(256) 评论(0) 推荐(0)
摘要: [抄题]: Design a class which receives a list of words in the constructor, and implements a method that takes two words word1 and word2 and return the sh 阅读全文
posted @ 2018-07-26 22:33 苗妙苗 阅读(384) 评论(0) 推荐(0)
上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 77 下一页