随笔分类 -  Level 2

1 2 3 4 5 ··· 12 下一页
摘要: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 阅读全文
posted @ 2024-12-28 06:07 北叶青藤 阅读(19) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-07-05 07:23 北叶青藤 阅读(56) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-06-25 01:58 北叶青藤 阅读(52) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-06-21 09:44 北叶青藤 阅读(37) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-06-21 07:40 北叶青藤 阅读(70) 评论(0) 推荐(0)
摘要:Design a stack which supports the following operations. Implement the CustomStack class: CustomStack(int maxSize) Initializes the object with maxSize  阅读全文
posted @ 2021-04-27 23:00 北叶青藤 阅读(110) 评论(0) 推荐(0)
摘要: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. 阅读全文
posted @ 2021-04-09 22:32 北叶青藤 阅读(60) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-09 21:38 北叶青藤 阅读(89) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-09 10:48 北叶青藤 阅读(67) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-08 09:12 北叶青藤 阅读(51) 评论(0) 推荐(0)
摘要: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  阅读全文
posted @ 2021-04-08 08:34 北叶青藤 阅读(48) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-08 08:17 北叶青藤 阅读(173) 评论(0) 推荐(0)
摘要: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, 阅读全文
posted @ 2021-04-08 08:13 北叶青藤 阅读(62) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-08 07:48 北叶青藤 阅读(83) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-08 02:53 北叶青藤 阅读(46) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-05 07:05 北叶青藤 阅读(58) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-29 05:43 北叶青藤 阅读(48) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-29 02:33 北叶青藤 阅读(59) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-29 01:11 北叶青藤 阅读(35) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-29 01:08 北叶青藤 阅读(80) 评论(0) 推荐(0)

1 2 3 4 5 ··· 12 下一页