摘要:
496. Next Greater Element IYou are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next 阅读全文
摘要:
Given a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any oneof them.Two t 阅读全文
摘要:
54. Spiral MatrixGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.Example 1:Input:[ [1, 2, 3, 4 阅读全文
摘要:
Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. DFS.函数头:private List<TreeNode> dfs(int sta 阅读全文
摘要:
Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n?Example:Input: 3Output: 5Explanation:Given n = 3, there ar 阅读全文
摘要:
There are n cities connected by m flights. Each fight starts from city u and arrives at v with a price w.Now given all the cities and fights, together 阅读全文
摘要:
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another ex 阅读全文
摘要:
Compare two version numbers version1 and version2.If version1 > version2 return 1; if version1 < version2 return -1;otherwise return 0.You may assume 阅读全文
摘要:
Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temp 阅读全文