摘要:
#week18 Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: 分析: 这是一题比较简单的递归 阅读全文
摘要:
#week17 There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 yo 阅读全文
摘要:
#week16 Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i 阅读全文
摘要:
#week15 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 ma 阅读全文
摘要:
#week14 Given an array nums of integers, you can perform operations on the array. In each operation, you pick any nums[i] and delete it to earn nums[i 阅读全文
摘要:
#week13 Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along it 阅读全文
摘要:
#week12 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 lon 阅读全文
摘要:
#week11 Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1: Input: [1,3,5,4,7] Output: 2 Explanation: T 阅读全文
摘要:
#week10 On an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. The rows and columns are 0 indexed 阅读全文
摘要:
#week9 Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays. Example 1: Input: A: [1,2,3,2,1] B: [3, 阅读全文