摘要:
Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.Fo... 阅读全文
摘要:
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees ofeverynode never differ by more than 1. 1 /** 2 * Definition for binary tree 3 * public class TreeNode { 4 * int val; 5 ... 阅读全文
摘要:
Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors 1 /** 2 * Definition for undirected graph. 3 * class Und... 阅读全文
摘要:
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ... 阅读全文