[LeetCode]Preimage Size of Factorial Zeroes Function
题目描述:LeetCode 793. Preimage Size of Factorial Zeroes FunctionLet f(x) be the number of zeroes at the end of x!. (Recall that x! = 1 * 2 * 3 * ... * x, and by convention, 0! = 1.)For example, f(3) = 0...
View ArticleLeetCode Weekly Contest 74解题报告
LeetCode Weekly Contest 74是LeetCode举办的第七十八场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-74/题解列表:LeetCode 794. Valid Tic-Tac-Toe StateLeetCode 792. Number of Matching...
View Article[LeetCode]Rotate String
题目描述:LeetCode 796. Rotate StringWe are given two strings, A and B.A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then...
View Article[LeetCode]All Paths From Source to Target
题目描述:LeetCode 797. All Paths From Source to TargetGiven a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and return them in any order.The graph is given as...
View Article[LeetCode]Champagne Tower
题目描述:LeetCode 799. Champagne TowerWe stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Each glass holds one cup (250ml) of...
View Article[LeetCode]Smallest Rotation with Highest Score
题目描述:LeetCode 798. Smallest Rotation with Highest Score Given an array A, we may rotate it by a non-negative integer K so that the array becomes A[K], A[K+1], A{K+2], ... A[A.length - 1], A[0], A[1],...
View ArticleLeetCode Weekly Contest 75解题报告
LeetCode Weekly Contest 75是LeetCode举办的第七十九场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-75/题解列表:LeetCode 796. Rotate StringLeetCode 797. All Paths From Source to...
View Article[LeetCode]Similar RGB Color
题目描述:LeetCode 800. Similar RGB ColorIn the following, every capital letter represents some hexadecimal digit from 0 to f.The red-green-blue color "#AABBCC" can be written as "#ABC" in shorthand. For...
View Article[LeetCode]Minimum Swaps To Make Sequences Increasing
题目描述:LeetCode 801. Minimum Swaps To Make Sequences IncreasingWe have two integer sequences A and B of the same non-zero length.We are allowed to swap elements A[i] and B[i]. Note that both elements...
View Article[LeetCode]Find Eventual Safe States
题目描述:LeetCode 802. Find Eventual Safe StatesIn a directed graph, we start at some node and every turn, walk along a directed edge of the graph. If we reach a node that is terminal (that is, it has no...
View Article[LeetCode]Bricks Falling When Hit
题目描述:LeetCode 803. Bricks Falling When HitWe have a grid of 1s and 0s; the 1s in a cell represent bricks. A brick will not drop if and only if it is directly connected to the top of the grid, or at...
View Article[LeetCode]Number of Lines To Write String
题目描述:LeetCode 806. Number of Lines To Write StringWe are to write the letters of a given string S, from left to right into lines. Each line has maximum width 100 units, and if writing a letter would...
View Article[LeetCode]Unique Morse Code Words
题目描述:LeetCode 804. Unique Morse Code WordsInternational Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to...
View Article[LeetCode]Max Increase to Keep City Skyline
题目描述:LeetCode 807. Max Increase to Keep City SkylineIn a 2 dimensional array grid, each value grid[i][j] represents the height of a building located there. We are allowed to increase the height of any...
View Article[LeetCode]Split Array With Same Average
题目描述:LeetCode 805. Split Array With Same AverageIn a given integer array A, we must move every element of A to either list B or list C. (B and C initially start empty.)Return true if and only if after...
View Article[LeetCode]Subdomain Visit Count
题目描述:LeetCode 811. Subdomain Visit CountA website domain like "discuss.leetcode.com" consists of various subdomains. At the top level, we have "com", at the next level, we have "leetcode.com", and at...
View Article[LeetCode]Expressive Words
题目描述:LeetCode 809. Expressive WordsSometimes people repeat letters to represent extra feeling, such as "hello" -> "heeellooo", "hi" -> "hiiii". Here, we have groups, of adjacent letters that are...
View Article[LeetCode]Soup Servings
题目描述:LeetCode 808. Soup ServingsThere are two types of soup: type A and type B. Initially we have N ml of each type of soup. There are four kinds of operations:Serve 100 ml of soup A and 0 ml of soup...
View Article[LeetCode]Largest Triangle Area
题目描述:LeetCode 812. Largest Triangle AreaYou have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points.Example:Input: points =...
View Article[LeetCode]Binary Tree Pruning
题目描述:LeetCode 814. Binary Tree PruningWe are given the head node root of a binary tree, where additionally every node's value is either a 0 or a 1.Return the same tree where every subtree (of the given...
View Article