摘要:
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 阅读全文
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
摘要:
Given a 2D array representing the coordinates on the map, there are only values 0, 1, 2 on the map. value 0 means that it can pass, value 1 means not 阅读全文
摘要:
You have a pointer at index 00 in an array of size arrLenarrLen. At each step, you can move 11 position to the left, 11 position to the right in the a 阅读全文
摘要:
Given a binary tree in which each node contains an integer number. Find the maximum possible subpath sum(both the starting and ending node of the subp 阅读全文
摘要:
Given a binary tree in which each node contains an integer number. Determine if there exists a path (the path can only be from one node to itself or t 阅读全文
摘要:
Given a binary tree, find the subtree with maximum average. Return the root of the subtree. Example 1 Input: {1,-5,11,1,2,4,-2} Output:11 Explanation: 阅读全文
摘要:
Given a binary tree, find the subtree with minimum sum. Return the root of the subtree. Example Example 1: Input: {1,-5,2,1,2,-4,-5} Output:1 Explanat 阅读全文
摘要:
Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the thr 阅读全文
摘要:
Find all pairs of elements in a given array that sum to the pair the given target number. Return all the distinct pairs of values. Assumptions The giv 阅读全文