[LeetCode]Split BST
题目描述:LeetCode 776. Split BSTGiven a Binary Search Tree (BST) with root node root, and a target value V, split the tree into two subtrees where one subtree has nodes that are all smaller or equal to the...
View Article[LeetCode]Swap Adjacent in LR String
题目描述:LeetCode 777. Swap Adjacent in LR StringIn a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move consists of either replacing one occurrence of "XL" with "LX", or replacing...
View Article[LeetCode]Swim in Rising Water
题目描述:LeetCode 778. Swim in Rising WaterOn an N x N grid, each square grid[i][j] represents the elevation at that point (i,j).Now rain starts to fall. At time t, the depth of the water everywhere is t....
View ArticleLeetCode Weekly Contest 70解题报告
LeetCode Weekly Contest 70是LeetCode举办的第七十四场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-70/题解列表:LeetCode 779. K-th Symbol in GrammarLeetCode 776. Split BSTLeetCode...
View Article[LeetCode]Minimum Distance Between BST Nodes
题目描述:LeetCode 783. Minimum Distance Between BST NodesGiven a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the...
View Article[LeetCode]Rabbits in Forest
题目描述:LeetCode 781. Rabbits in ForestIn a forest, each rabbit has some color. Some subset of rabbits (possibly all of them) tell you how many other rabbits have the same color as them. Those answers are...
View Article[LeetCode]Reaching Points
题目描述:LeetCode 780. Reaching PointsA move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y, y).Given a starting point (sx, sy) and a target point (tx, ty), return True if...
View Article[LeetCode]Letter Case Permutation
题目描述:LeetCode 784. Letter Case PermutationGiven a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we...
View Article[LeetCode]Is Graph Bipartite?
题目描述:LeetCode 785. Is Graph Bipartite?Given a graph, return true if and only if it is bipartite.Recall that a graph is bipartite if we can split it's set of nodes into two independent subsets A and B...
View Article[LeetCode]Cheapest Flights Within K Stops
题目描述:LeetCode 787. Cheapest Flights Within K StopsThere are n cities connected by m flights. Each fight starts from city u and arrives at v with a price w.Now given all the cities and fights, together...
View Article[LeetCode]K-th Smallest Prime Fraction
题目描述:LeetCode 786. K-th Smallest Prime FractionA sorted list A contains 1, plus some number of primes. Then, for every p < q in the list, we consider the fraction p/q.What is the K-th smallest...
View ArticleLeetCode Weekly Contest 72解题报告
LeetCode Weekly Contest 72是LeetCode举办的第七十四场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-72/题解列表:LeetCode 784. Letter Case PermutationLeetCode 785. Is Graph...
View Article[LeetCode]Rotated Digits
题目描述:LeetCode 788. Rotated DigitsX is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. A number is valid if each digit remains a...
View Article[LeetCode]Escape The Ghosts
题目描述:LeetCode 789. Escape The GhostsYou are playing a simplified Pacman game. You start at the point (0, 0), and your destination is (target[0], target[1]). There are several ghosts on the map, the...
View Article[LeetCode]Custom Sort String
题目描述:LeetCode 791. Custom Sort StringS 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 permute the...
View Article[LeetCode]Domino and Tromino Tiling
题目描述:LeetCode 790. Domino and Tromino TilingWe have two types of tiles: a 2x1 domino shape, and an "L" tromino shape. These shapes may be rotated. XX <- domino XX <- "L" tromino XGiven N, how...
View ArticleLeetCode Weekly Contest 73解题报告
LeetCode Weekly Contest 73是LeetCode举办的第七十七场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-73/题解列表:LeetCode 788. Rotated DigitsLeetCode 789. Escape The GhostsLeetCode...
View Article[LeetCode]Valid Tic-Tac-Toe State
题目描述:LeetCode 794. Valid Tic-Tac-Toe StateA Tic-Tac-Toe board is given as a string array board. Return True if and only if it is possible to reach this board position during the course of a valid...
View Article[LeetCode]Number of Matching Subsequences
题目描述:LeetCode 792. Number of Matching SubsequencesGiven string S and a dictionary of words words, find the number of words[i] that is a subsequence of S.Example :Input: S = "abcde" words = ["a", "bb",...
View Article[LeetCode]Number of Subarrays with Bounded Maximum
题目描述:LeetCode 795. Number of Subarrays with Bounded MaximumWe are given an array A of positive integers, and two positive integers L and R (L <= R).Return the number of (contiguous, non-empty)...
View Article