LeetCode Weekly Contest 49解题报告
LeetCode Weekly Contest 49是LeetCode举办的第五十三场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-49/题解列表:LeetCode 674. Longest Continuous Increasing SubsequenceLeetCode 676....
View Article[LeetCode]Valid Palindrome II
题目描述:LeetCode 680. Valid Palindrome IIGiven a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.Example 1:Input:"aba"Output: TrueExample...
View Article[LeetCode]Map Sum Pairs
题目描述:LeetCode 677. Map Sum PairsImplement a MapSum class with insert, and sum methods.For the method insert, you'll be given a pair of (string, integer). The string represents the key and the integer...
View Article[LeetCode]Valid Parenthesis String
题目描述:LeetCode 678. Valid Parenthesis StringGiven a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define the validity of...
View Article[LeetCode]24 Game
题目描述:LeetCode 679. 24 GameYou have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *, /, +, -, (, ) to get the value of 24.Example 1:Input: [4, 1, 8,...
View ArticleLeetCode Weekly Contest 50解题报告
LeetCode Weekly Contest 50是LeetCode举办的第五十三场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-50/题解列表:LeetCode 680. Valid Palindrome IILeetCode 677. Map Sum PairsLeetCode...
View Article[LeetCode]Baseball Game
题目描述:LeetCode 682. Baseball GameYou're now a baseball game point recorder.Given a list of strings, each string can be one of the 4 following types:Integer (one round's score): Directly represents the...
View Article[LeetCode]Next Closest Time
题目描述:LeetCode 681. Next Closest TimeGiven a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit can be...
View Article[LeetCode]Redundant Connection
题目描述:LeetCode 684. Redundant ConnectionWe are given a "tree" in the form of a 2D-array, with distinct values for each node.In the given 2D-array, each element pair [u, v] represents that v is a child...
View Article[LeetCode]K Empty Slots
题目描述:LeetCode 683. K Empty SlotsThere is a garden with N slots. In each slot, there is a flower. The N flowers will bloom one by one in N days. In each day, there will be exactly one flower blooming...
View ArticleLeetCode Weekly Contest 51解题报告
LeetCode Weekly Contest 51是LeetCode举办的第五十五场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-51/题解列表:LeetCode 682. Baseball GameLeetCode 681. Next Closest TimeLeetCode 684....
View Article[LeetCode]Redundant Connection II
题目描述:LeetCode 685. Redundant Connection IIIn this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus...
View Article[LeetCode]Employee Importance
题目描述:LeetCode 690. Employee ImportanceYou are given a data structure of employee information, which includes the employee's unique id, his importance value and his direct subordinates' id.For example,...
View Article[LeetCode]Repeated String Match
题目描述:LeetCode 686. Repeated String MatchGiven two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no such solution, return -1.For example,...
View Article[LeetCode]Longest Univalue Path
题目描述:LeetCode 687. Longest Univalue PathGiven a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root.Note: The...
View Article[LeetCode]Knight Probability in Chessboard
题目描述:LeetCode 688. Knight Probability in ChessboardOn an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. The rows and columns are 0 indexed, so the...
View Article[LeetCode]Maximum Sum of 3 Non-Overlapping Subarrays
题目描述:LeetCode 689. Maximum Sum of 3 Non-Overlapping SubarraysIn a given array nums of positive integers, find three non-overlapping subarrays with maximum sum.Each subarray will be of size k, and we...
View ArticleLeetCode Weekly Contest 52解题报告
LeetCode Weekly Contest 52是LeetCode举办的第五十六场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-52/题解列表:LeetCode 686. Repeated String MatchLeetCode 687. Longest Univalue...
View Article[LeetCode]Binary Number with Alternating Bits
题目描述:LeetCode 693. Binary Number with Alternating BitsGiven a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values.Example 1:Input:...
View Article[LeetCode]Max Area of Island
题目描述:LeetCode 695. Max Area of IslandGiven a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume...
View Article