If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order). The replacement must be in-place, do not allocate extra memory. Here are some examples. Inputs are in the left-hand column and its corresponding outputs are in the righ...
987 Vertical Order Traversal of a Binary Tree Hard Python 988 Smallest String Starting From Leaf Medium JavaScript 989 Add to Array-Form of Integer Easy JavaScript TypeScript Go 990 Satisfiability of Equality Equations Medium Rust 991 Broken Calculator Medium JavaScript 993 Cousins in Binary Tree Easy...
889 Construct Binary Tree from Preorder and Postorder Traversal 60.70% Medium 888 Fair Candy Swap 56.90% Easy 887 Super Egg Drop 24.90% Hard 886 Possible Bipartition 40.90% Medium 885 Spiral Matrix III 64.80% Medium 884 Uncommon Words from Two Sentences 60.90% Easy 883 Projection Area of 3D Sh...
0094 Binary Tree Inorder Traversal Go 72.9% Easy 0095 Unique Binary Search Trees II Go 51.4% Medium 0096 Unique Binary Search Trees Go 59.2% Medium 0097 Interleaving String Go 37.1% Medium 0098 Validate Binary Search Tree Go 31.7% Medium 0099 Recover Binary Search Tree Go 50.2% Medium...
0106 Construct Binary Tree from Inorder and Postorder Traversal Go 47.1% Medium 0107 Binary Tree Level Order Traversal II Go 53.5% Easy 0108 Convert Sorted Array to Binary Search Tree Go 57.9% Easy 0109 Convert Sorted List to Binary Search Tree Go 47.6% Medium 0110 Balanced Binary Tree...
#94. Binary Tree Inorder Traversal (M-) 1400 #150. Evaluate Reverse Polish Notation (M) 1500 #316. Remove Duplicate Letters (M+) 1600 #682. Baseball Game (E+) 1100 #735. Asteroid Collision (M-) 1400 #1003. Check If Word Is Valid After Substitutions (M-) 1400 #1047. Re...
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. 【解答】checkBalanced方法用来递归检查是否平衡的,返回树高度,偷了个巧,如果发现不平衡抛出TreeUnbalancedException异常: ...
54.Spiral Matrix Medium Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the following matrix: [[ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]] You should return [1,2,3,6,9,8,7,4,5]. public ...
989 数组形式的整数加法 - Add to Array-Form of Integer C++ Java Python3 Easy 988 从叶结点开始的最小字符串 - Smallest String Starting From Leaf C++ Java Python3 Medium 987 二叉树的垂序遍历 - Vertical Order Traversal of a Binary Tree C++ Java Python3 Medium 986 区间列表的交集 - Interval ...
889 Construct Binary Tree from Preorder and Postorder Traversal 60.70% Medium 888 Fair Candy Swap 56.90% Easy 887 Super Egg Drop 24.90% Hard 886 Possible Bipartition 40.90% Medium 885 Spiral Matrix III 64.80% Medium 884 Uncommon Words from Two Sentences 60.90% Easy 883 Projection Area of 3D Sh...