10 2020 档案
摘要:Given an n-ary tree, return the level order traversal of its nodes' values. Nary-Tree input serialization is represented in their level order traversa
阅读全文
摘要:Given the root of a binary tree with N nodes, each node in the tree has node.val coins, and there are N coins total. In one move, we may choose two ad
阅读全文
摘要:Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there
阅读全文
摘要:You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following defin
阅读全文
摘要:Given an m x n matrix. If an element is 0, set its entire row and column to 0. Do it in-place. Follow up: A straight forward solution using O(mn) spac
阅读全文
摘要:Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary search tree. You may assume each number in the seq
阅读全文
摘要:Design a HashMap without using any built-in hash table libraries. To be specific, your design should include these functions: put(key, value) : Insert
阅读全文
摘要:Create a timebased key-value store class TimeMap, that supports two operations. 1. set(string key, string value, int timestamp) Stores the key and val
阅读全文
摘要:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two
阅读全文
摘要:The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following seque
阅读全文
摘要:Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam
阅读全文
摘要:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo
阅读全文
摘要:Design your implementation of the linked list. You can choose to use a singly or doubly linked list.A node in a singly linked list should have two att
阅读全文
摘要:Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example
阅读全文
摘要:Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: LRUCache(int capacity) Initia
阅读全文
摘要:Given a collection of intervals, merge all overlapping intervals. Example 1: Input: intervals = [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15
阅读全文
摘要:Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord,
阅读全文
摘要:Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime com
阅读全文
摘要:Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference room
阅读全文

浙公网安备 33010602011771号