11 2019 档案
摘要:原题链接在这里:https://leetcode.com/problems/delete-nodes-and-return-forest/ 题目: Given the root of a binary tree, each node in the tree has a distinct value.
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/matchsticks-to-square/ 题目: Remember the story of Little Match Girl? By now, you know exactly what matchsticks th
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/possible-bipartition/ 题目: Given a set of N people (numbered 1, 2, ..., N), we would like to split everyone into
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/sentence-similarity-ii/ 题目: Given two sentences words1, words2 (each represented as an array of strings), and a
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/sentence-similarity/ 题目: Given two sentences words1, words2 (each represented as an array of strings), and a lis
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/increasing-subsequences/ 题目: Given an integer array, your task is to find all the different possible increasing
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/number-of-enclaves/ 题目: Given a 2D array A, each cell is 0 (representing sea) or 1 (representing land) A move co
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/lonely-pixel-i/ 题目: Given a picture consisting of black and white pixels, find the number of black lonely pixels
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/shortest-path-in-binary-matrix/ 题目: In an N by N square grid, each cell is either empty (0) or blocked (1). A cl
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/n-ary-tree-postorder-traversal/ 题目: Given an n-ary tree, return the postorder traversal of its nodes' values. Na
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/n-ary-tree-preorder-traversal/ 题目: Given an n-ary tree, return the preorder traversal of its nodes' values. Nary
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/minimum-knight-moves/ 题目: In an infinite chess board with coordinates from -infinity to +infinity, you have a kn
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/shortest-bridge/ 题目: In a given 2D binary array A, there are two islands. (An island is a 4-directionally connec
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/open-the-lock/ 题目: You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/the-maze-iii/ 题目: There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/the-maze-ii/ 题目: There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/the-maze/ 题目: There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rol
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/n-ary-tree-level-order-traversal/ 题目: Given an n-ary tree, return the level order traversal of its nodes' values
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/online-election/ 题目: In an election, the i-th vote was cast for persons[i] at time times[i]. Now, we would like
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/binary-search/ 题目: Given a sorted (in ascending order) integer array nums of n elements and a target value, writ
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/search-in-a-sorted-array-of-unknown-size/ 题目: Given an integer array sorted in ascending order, write a function
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/time-based-key-value-store/ 题目: Create a timebased key-value store class TimeMap, that supports two operations.
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-right-interval/ 题目: Given a set of intervals, for each of the interval i, check if there exists an interval
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/missing-element-in-sorted-array/ 题目: Given a sorted array A of unique numbers, find the K-th missing number star
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/ 题目: A conveyor belt has packages that must be shipped from one port to
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/koko-eating-bananas/ 题目: Koko loves to eat bananas. There are N piles of bananas, the i-th pile has piles[i] ban
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/my-calendar-iii/ 题目: Implement a MyCalendarThree class to store your events. A new event can always be added. Yo
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/my-calendar-ii/ 题目: Implement a MyCalendarTwo class to store your events. A new event can be added if adding the
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/exam-room/ 题目: In an exam room, there are N seats in a single row, numbered 0, 1, 2, ..., N-1. When a student en
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/hand-of-straights/ 题目: Alice has a hand of cards, given as an array of integers. Now she wants to rearrange the
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/camelcase-matching/ 题目: A query word matches a given pattern if we can insert lowercase letters to the pattern w
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/map-sum-pairs/ 题目: Implement a MapSum class with insert, and sum methods. For the method insert, you'll be given
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/implement-magic-dictionary/ 题目: Implement a magic directory with buildDict, and search methods. For the method b
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/additive-number/ 题目: Additive number is a string whose digits can form additive sequence. A valid additive seque
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/maximum-length-of-a-concatenated-string-with-unique-characters/ 题目: Given an array of strings arr. String s is a
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/stepping-numbers/ 题目: A Stepping Number is an integer such that all of its adjacent digits have an absolute diff
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/split-array-into-fibonacci-sequence/ 题目: Given a string S of digits, such as S = "123456579", we can split it in
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/brace-expansion/ 题目: A string S represents a list of words. Each letter in the word has 1 or more options. If th
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/path-with-maximum-gold/ 题目: In a gold mine grid of size m * n, each cell in this mine has an integer representin
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/letter-tile-possibilities/ 题目: You have a set of tiles, where each tile has one letter tiles[i] printed on it. R
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/last-stone-weight-ii/ 题目: We have a collection of rocks, each rock has a positive integer weight. Each turn, we
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/last-stone-weight/ 题目: We have a collection of rocks, each rock has a positive integer weight. Each turn, we cho
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/largest-1-bordered-square/ 题目: Given a 2D grid of 0s and 1s, return the number of elements in the largest square
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/largest-plus-sign/ 题目: In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in th
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/filling-bookcase-shelves/ 题目: We have a sequence of books: the i-th book has thickness books[i][0] and height bo
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/longest-arithmetic-sequence/ 题目: Given an array A of integers, return the length of the longest arithmetic subse
阅读全文