LeetCode Weekly Contest 45解题报告
LeetCode Weekly Contest 45是LeetCode举办的第五十场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-45/题解列表:LeetCode 657. Judge Route CircleLeetCode 658. Find K Closest...
View Article[LeetCode]Image Smoother
题目描述:LeetCode 661. Image SmootherGiven a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the average gray scale...
View Article[LeetCode]Maximum Width of Binary Tree
题目描述:LeetCode 662. Maximum Width of Binary TreeGiven a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binary...
View Article[LeetCode]Equal Tree Partition
题目描述:LeetCode 663. Equal Tree PartitionGiven a binary tree with n nodes, your task is to check if it's possible to partition the tree to two trees which have the equal sum of values after removing...
View Article[LeetCode]Strange Printer
题目描述:LeetCode 664. Strange PrinterThere is a strange printer with the following two special requirements:The printer can only print a sequence of the same character each time.At each turn, the printer...
View ArticleLeetCode Weekly Contest 46解题报告
LeetCode Weekly Contest 46是LeetCode举办的第五十一场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-46/题解列表:LeetCode 661. Image SmootherLeetCode 662. Maximum Width of Binary...
View Article[LeetCode]Non-decreasing Array
题目描述:LeetCode 665. Non-decreasing ArrayGiven an array with n integers, your task is to check if it could become non-decreasing by modifying at most1 element.We define an array is non-decreasing if...
View Article[LeetCode]Path Sum IV
题目描述:LeetCode 666. Path Sum IVIf the depth of a tree is smaller than 5, then this tree can be represented by a list of three-digits integers.For each integer in this list:The hundreds digit represents...
View Article[LeetCode]Beautiful Arrangement II
题目描述:LeetCode 667. Beautiful Arrangement IIGiven two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requirement:...
View Article[LeetCode]Kth Smallest Number in Multiplication Table
题目描述:LeetCode 668. Kth Smallest Number in Multiplication TableNearly every one have used the Multiplication Table. But could you find out the k-th smallest number quickly from the multiplication...
View ArticleLeetCode Weekly Contest 47解题报告
LeetCode Weekly Contest 47是LeetCode举办的第五十二场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-47/题解列表:LeetCode 665. Non-decreasing ArrayLeetCode 666. Path Sum IVLeetCode...
View Article[LeetCode]Second Minimum Node In a Binary Tree
题目描述:LeetCode 671. Second Minimum Node In a Binary TreeGiven a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero...
View Article[LeetCode]Trim a Binary Search Tree
题目描述:LeetCode 669. Trim a Binary Search TreeGiven a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might...
View Article[LeetCode]Maximum Swap
题目描述:LeetCode 670. Maximum SwapGiven a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get.Example 1:Input:...
View Article[LeetCode]Bulb Switcher II
题目描述:LeetCode 672. Bulb Switcher IIThere is a room with n lights which are turned on initially and 4 buttons on the wall. After performing exactly m unknown operations towards buttons, you need to...
View ArticleLeetCode Weekly Contest 48解题报告
LeetCode Weekly Contest 48是LeetCode举办的第五十三场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-48/题解列表:LeetCode 671. Second Minimum Node In a Binary TreeLeetCode 669. Trim a...
View Article[LeetCode]Longest Continuous Increasing Subsequence
题目描述:LeetCode 674. Longest Continuous Increasing SubsequenceGiven an unsorted array of integers, find the length of longest continuous increasing subsequence.Example 1:Input: [1,3,5,4,7]Output:...
View Article[LeetCode]Implement Magic Dictionary
题目描述:LeetCode 676. Implement Magic DictionaryImplement a magic directory with buildDict, and search methods.For the method buildDict, you'll be given a list of non-repetitive words to build a...
View Article[LeetCode]Cut Off Trees for Golf Event
题目描述:LeetCode 675. Cut Off Trees for Golf EventYou are asked to cut off trees in a forest for a golf event. The forest is represented as a non-negative 2D map, in this map:0 represents the obstacle...
View Article[LeetCode]Number of Longest Increasing Subsequence
题目描述:LeetCode 673. Number of Longest Increasing SubsequenceGiven an unsorted array of integers, find the number of longest increasing subsequence.Example 1:Input: [1,3,5,4,7]Output: 2Explanation: The...
View Article