摘要:
题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identica... 阅读全文
摘要:
题目:Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3... 阅读全文
摘要:
题目:Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,... 阅读全文
摘要:
题目:Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3... 阅读全文
摘要:
题目:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], ... 阅读全文
摘要:
题目:There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the followin... 阅读全文
摘要:
题目:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after rain... 阅读全文
摘要:
题目: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 com... 阅读全文
摘要:
题目: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 com... 阅读全文
摘要:
题目:Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transact... 阅读全文
摘要:
题目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1... 阅读全文
摘要:
题目:Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all suc... 阅读全文