随笔分类 - Level 2
摘要:Description Given two nodes of a binary tree p and q, return their lowest common ancestor (LCA). Each node will have a reference to its parent node. T
        阅读全文
                
摘要:You are a hiker preparing for an upcoming hike. You are given heights, a 2D array of size rows x columns, where heights[row][col] represents the heigh
        阅读全文
                
摘要:You are given a list of edges in a graph with weight. Find all the paths between start node and end node with min weights in the path. The edges like 
        阅读全文
                
摘要:You have a browser of one tab where you start on the homepage and you can visit another url, get back in the history number of steps or move forward i
        阅读全文
                
摘要:We are given some website visits: the user with name username[i] visited the website website[i] at time timestamp[i]. A 3-sequence is a list of websit
        阅读全文
                
摘要:Design a stack which supports the following operations. Implement the CustomStack class: CustomStack(int maxSize) Initializes the object with maxSize 
        阅读全文
                
摘要:Given a n * n matrix grid of 0's and 1's only. We want to represent the grid with a Quad-Tree. Return the root of the Quad-Tree representing the grid.
        阅读全文
                
摘要:You are the manager of a basketball team. For the upcoming tournament, you want to choose the team with the highest overall score. The score of the te
        阅读全文
                
摘要:Given a 2D grid consists of 0s (land) and 1s (water). An island is a maximal 4-directionally connected group of 0s and a closed island is an island to
        阅读全文
                
摘要:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo
        阅读全文
                
摘要:Given a root of an N-ary tree, you need to compute the length of the diameter of the tree. The diameter of an N-ary tree is the length of the longest 
        阅读全文
                
摘要:You have a graph of n nodes. You are given an integer n and an array edges where edges[i] = [ai, bi] indicates that there is an edge between ai and bi
        阅读全文
                
摘要:We are given a list schedule of employees, which represents the working time for each employee. Each employee has a list of non-overlapping Intervals,
        阅读全文
                
摘要:You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rota
        阅读全文
                
摘要:S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want to per
        阅读全文
                
摘要:There are n cities connected by m flights. Each flight starts from city u and arrives at v with a price w. Now given all the cities and flights, toget
        阅读全文
                
摘要:Given a binary search tree, return a balanced binary search tree with the same node values. A binary search tree is balanced if and only if the depth 
        阅读全文
                
摘要:Given an integer array nums which is sorted in ascending order and all of its elements are unique and given also an integer k, return the kth missing 
        阅读全文
                
摘要:You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an int
        阅读全文
                
摘要:Given the root of a binary tree, determine if it is a complete binary tree. In a complete binary tree, every level, except possibly the last, is compl
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号