LeetCode Weekly Contest 37解题报告
LeetCode Weekly Contest 37是LeetCode举办的第四十二场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-37/题解列表:LeetCode 624. Maximum Distance in ArraysLeetCode 623. Add One Row to...
View Article[LeetCode]Maximum Product of Three Numbers
题目描述:LeetCode 628. Maximum Product of Three NumbersGiven an integer array, find three numbers whose product is maximum and output the maximum product.Example 1:Input: [1,2,3]Output: 6Example 2:Input:...
View Article[LeetCode]Course Schedule III
题目描述:LeetCode 630. Course Schedule IIIThere are n different online courses numbered from 1 to n. Each course has some duration(course length) t and closed on dth day. A course should be taken...
View Article[LeetCode]K Inverse Pairs Array
题目描述:LeetCode 629. K Inverse Pairs ArrayGiven two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs.We define an inverse pair...
View Article[LeetCode]Design Excel Sum Formula
题目描述:LeetCode 631. Design Excel Sum FormulaYour task is to design the basic function of Excel and implement the function of sum formula. Specifically, you need to implement the following...
View ArticleLeetCode Weekly Contest 38解题报告
LeetCode Weekly Contest 38是LeetCode举办的第四十三场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-38/题解列表:LeetCode 628. Maximum Product of Three NumbersLeetCode 630. Course...
View Article[LeetCode]Sum of Square Numbers
题目描述:LeetCode 633. Sum of Square NumbersGiven a non-negative integer c, your task is to decide whether there're two integers a and b such that a2 + b2 = c.Example 1:Input: 5Output: TrueExplanation: 1 *...
View Article[LeetCode]Design Log Storage System
题目描述:LeetCode 635. Design Log Storage SystemYou are given several logs that each log contains a unique id and timestamp. Timestamp is a string that has the following format:...
View Article[LeetCode]Find the Derangement of An Array
题目描述:LeetCode 634. Find the Derangement of An ArrayIn combinatorial mathematics, a derangement is a permutation of the elements of a set, such that no element appears in its original position.There's...
View Article[LeetCode]Smallest Range
题目描述:LeetCode 632. Smallest RangeYou have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists.We define the range [a,b] is...
View ArticleLeetCode Weekly Contest 39解题报告
LeetCode Weekly Contest 39是LeetCode举办的第四十四场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-39/题解列表:LeetCode 633. Sum of Square NumbersLeetCode 635. Design Log Storage...
View Article[LeetCode]Average of Levels in Binary Tree
题目描述:LeetCode 637. Average of Levels in Binary TreeGiven a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7Output:...
View Article[LeetCode]Solve the Equation
题目描述:LeetCode 640. Solve the EquationSolve a given equation and return the value of x in the form of string "x=#value". The equation contains only '+', '-' operation, the variable x and its...
View Article[LeetCode]Shopping Offers
题目描述:LeetCode 638. Shopping OffersIn LeetCode Store, there are some kinds of items to sell. Each item has a price.However, there are some special offers, and a special offer consists of one or more...
View Article[LeetCode]Decode Ways II
题目描述:LeetCode 639. Decode Ways IIA message containing letters from A-Z is being encoded to numbers using the following mapping way:'A' -> 1'B' -> 2 ...'Z' -> 26Beyond that, now the encoded...
View ArticleLeetCode Weekly Contest 40解题报告
LeetCode Weekly Contest 40是LeetCode举办的第四十五场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-40/题解列表:LeetCode 637. Average of Levels in Binary TreeLeetCode 640. Solve the...
View Article[LeetCode]Maximum Average Subarray I
题目描述:LeetCode 643. Maximum Average Subarray IGiven an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the...
View Article[LeetCode]Exclusive Time of Functions
题目描述:LeetCode 636. Exclusive Time of FunctionsGiven the running logs of n functions that are executed in a nonpreemptive single threaded CPU, find the exclusive time of these functions.Each function...
View Article[LeetCode]Maximum Average Subarray II
题目描述:LeetCode 644. Maximum Average Subarray IIGiven an array consisting of n integers, find the contiguous subarray whose length is greater than or equal tok that has the maximum average value. And you...
View Article[LeetCode]Design Search Autocomplete System
题目描述:LeetCode 642. Design Search Autocomplete SystemDesign a search autocomplete system for a search engine. Users may input a sentence (at least one word and end with a special character '#'). For...
View Article