06 2017 档案
摘要:Given an integer array, find three numbers whose product is maximum and output the maximum product.Example 1:Input: [1,2,3] Output: 6 Example 2:Input: [1,2,3,4] Output: 24 Note:The length of the given...
阅读全文
摘要:Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST.Assume a BST is defined as follows:The left subtree of a node contains on...
阅读全文
摘要:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between tw...
阅读全文
摘要:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 But the...
阅读全文
摘要:Total Accepted: 5540Total Submissions: 14066Difficulty: EasyContributors:love_FawnWe define a harmonious array is an array where the difference between its maximum value and its minimum value is exact...
阅读全文
摘要:Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,null,15,7], ...
阅读全文
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree. ...
阅读全文
摘要:把LeetCode二叉树题目的测试数组,转换成二叉树using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace Algorithm { class TreeNode { public int val; ...
阅读全文
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum = 22...
阅读全文
摘要:You are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the root or a leaf, but it must go...
阅读全文
摘要:Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this node...
阅读全文
摘要:Total Accepted: 2202Total Submissions: 3988Difficulty: EasyContributors:love_FawnYou need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way...
阅读全文
摘要:Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings.You need to help them find out their common interest with the le...
阅读全文

浙公网安备 33010602011771号