[LeetCode]Find Left Most Element
题目描述:LeetCode 513. Find Left Most ElementGiven a binary tree, find the leftmost value in the last row of the tree.Example 1: Input: 2 / \ 1 3 Output: 1 Example 2: Input: 1 / \ 2 3 / / \ 4 5 6 / 7...
View Article[LeetCode]Find Largest Element in Each Row
题目描述:LeetCode 515. Find Largest Element in Each RowYou need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3,...
View Article[LeetCode]Reverse Pairs
题目描述:LeetCode 493. Reverse PairsGiven an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j].You need to return the number of important reverse pairs in the...
View ArticleLeetCode Weekly Contest 19解题报告
LeetCode Weekly Contest 19是LeetCode举办的第二十四场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-19/题解列表:LeetCode 504. Base 7LeetCode 513. Find Left Most ElementLeetCode 515....
View Article[LeetCode]Longest Palindromic Subsequence
题目描述:LeetCode 516. Longest Palindromic SubsequenceGiven a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.Example 1:...
View Article[LeetCode]Coin Change 2
题目描述:LeetCode 518. Coin Change 2You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that amount. You may...
View Article[LeetCode]Detect Capital
题目描述:LeetCode 520. Detect CapitalGiven a word, you need to judge whether the usage of capitals in it is right or not.We define the usage of capitals in a word to be right when one of the following...
View Article[LeetCode]Beautiful Arrangement
题目描述:LeetCode 526. Beautiful ArrangementSuppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of the...
View Article[LeetCode]Contiguous Array
题目描述:LeetCode 525. Contiguous ArrayGiven a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1.Example 1: Input: [0,1] Output: 2 Explanation: [0, 1] is the...
View Article[LeetCode]Super Washing Machines
题目描述:LeetCode 517. Super Washing MachinesYou have n super washing machines on a line. Initially, each washing machine has some dresses or is empty.For each move, you could choose any m (1 ≤ m ≤ n)...
View ArticleLeetCode Weekly Contest 20解题报告
LeetCode Weekly Contest 20是LeetCode举办的第二十五场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-20/题解列表:LeetCode 520. Detect CapitalLeetCode 526. Beautiful ArrangementLeetCode...
View Article[LeetCode]Minimum Absolute Difference in BST
题目描述:LeetCode 530. Minimum Absolute Difference in BSTGiven a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.Example:Input: 1 \ 3 / 2...
View Article[LeetCode]Continuous Subarray Sum
题目描述:LeetCode 523. Continuous Subarray SumGiven a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up...
View Article[LeetCode]Longest Word in Dictionary through Deleting
题目描述:LeetCode 524. Longest Word in Dictionary through DeletingGiven a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the...
View Article[LeetCode]Minesweeper
题目描述:LeetCode 529. MinesweeperLet's play the minesweeper game (Wikipedia, online game)!You are given a 2D char matrix representing the game board. 'M' represents an unrevealed mine, 'E' represents an...
View ArticleLeetCode Weekly Contest 21解题报告
LeetCode Weekly Contest 21是LeetCode举办的第二十六场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-21/题解列表:LeetCode 530. Minimum Absolute Difference in BSTLeetCode 523....
View Article[LeetCode]K-diff Pairs in an Array
题目描述:LeetCode 532. K-diff Pairs in an ArrayGiven an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair...
View Article[LeetCode]Lonely Pixel I
题目描述:LeetCode 531. Lonely Pixel IGiven a picture consisting of black and white pixels, find the number of black lonely pixels.The picture is represented by a 2D char array consisting of 'B' and 'W',...
View Article[LeetCode]Lonely Pixel II
题目描述:LeetCode 533. Lonely Pixel IIGiven a picture consisting of black and white pixels, and a positive integer N, find the number of black pixels located at some specific row R and column C that align...
View Article[LeetCode]Freedom Trail
题目描述:LeetCode 514. Freedom TrailIn the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring", and use the dial to spell a specific...
View Article