Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number in the array. The left …
Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. For example, given inorder = …
Design and implement an iterator to flatten a 2d vector. It should support the following operations: next and hasNext. Example: Vector2D iterator = new Vector2D(,,]); iterator.next(); // return 1 …
Given a paragraph and a list of banned words, return the most frequent word that is not in the list of banned words. It is guaranteed there is at …
There are N cities numbered from 1 to N. You are given connections, where each connections = represents the cost to connect city1 and city2 together. (A connection is …