摘要:
Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be integ 阅读全文
摘要:
Design a data structure that supports all following operations in O(1) time. Example: Analysis: For O(1) insert and remove, we need HashMap. For O(1) 阅读全文
摘要:
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each hou 阅读全文
摘要:
Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so tha 阅读全文
摘要:
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
摘要:
Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam 阅读全文
摘要:
Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Your algorithm 阅读全文
摘要:
Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest i 阅读全文
摘要:
You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the w 阅读全文
摘要:
Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example: Given n = 2, return 91. (The answer should be the 阅读全文