[LeetCode]Word Squares
题目描述:LeetCode 425. Word SquaresGiven a set of words (without duplicates), find all word squares you can build from them.A sequence of words forms a valid word square if the kth row and column read the...
View ArticleLeetCode Weekly Contest 9解题报告
LeetCode Weekly Contest 9是LeetCode举办的第八场正式周赛,共4道题目,比赛时长2.5小时。比赛链接:https://leetcode.com/contest/detail/9题解列表:LeetCode 422. Valid Word SquareLeetCode 423. Reconstruct Original Digits from EnglishLeetCode...
View Article[LeetCode]All O`one Data Structure
题目描述:LeetCode 432. All O`one Data StructureImplement a data structure supporting the following operations:Inc(Key) - Inserts a new key with value 1. Or increments an existing key by 1. Key is...
View Article[LeetCode]Minimum Genetic Mutation
题目描述:LeetCode 433. Minimum Genetic MutationA gene string can be represented by an 8-character long string, with choices from "A","C","G","T". Suppose we need to investigate about a mutation (mutation...
View Article[LeetCode]Strong Password Checker
题目描述:LeetCode 420. Strong Password CheckerA password is considered strong if below conditions are all met:It has at least 6 characters and at most 20 characters.It must contain at least one lowercase...
View Article[LeetCode]Path Sum III
题目描述:LeetCode 437. Path Sum IIIYou are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the...
View Article[LeetCode]Find All Anagrams in a String
题目描述:LeetCode 438. Find All Anagrams in a StringGiven a string s and a non-empty string p, find all the start indices of p's anagrams in s.Strings consists of lowercase English letters only and the...
View Article[LeetCode]Ternary Expression Parser
题目描述:LeetCode 439. Ternary Expression ParserGiven a string representing arbitrarily nested ternary expressions, calculate the result of the expression. You can always assume that the given expression...
View Article[LeetCode]K-th Smallest in Lexicographical Order
题目描述:LeetCode 440. K-th Smallest in Lexicographical OrderGiven integers n and k, find the lexicographically k-th smallest integer in the range from 1 to n.Note: 1 ≤ k ≤ n ≤ 109.Example:Input: n: 13 k:...
View Article[LeetCode]Smarking Algorithm Contest解题报告
Smarking Algorithm Contest是LeetCode举办的第九场正式周赛,共4道题目,比赛时长2.5小时。比赛链接:https://leetcode.com/contest/detail/10题解列表:LeetCode 437. Path Sum IIILeetCode 438. Find All Anagrams in a StringLeetCode 439. Ternary...
View Article[LeetCode]Find All Duplicates in an Array
题目描述:LeetCode 442. Find All Duplicates in an ArrayGiven an array of integers, 1 <= a[i] <= n (n = size of array), some elements appear twice and others appear once. Find all the elements that...
View Article[LeetCode]Add Two Numbers II
题目描述:LeetCode 445. Add Two Numbers IIYou are given two linked lists representing two non-negative numbers. The most significant digit comes first and each of their nodes contain a single digit. Add the...
View Article[LeetCode]Non-overlapping Intervals
题目描述:LeetCode 435. Non-overlapping IntervalsGiven a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note:You may...
View Article[LeetCode]Find Right Interval
题目描述:LeetCode 436. Find Right IntervalGiven a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point of the...
View Article[LeetCode]Arranging Coins
题目描述:LeetCode 441. Arranging CoinsYou have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.Given n, find the total number of full staircase...
View Article[LeetCode]Sequence Reconstruction
题目描述:LeetCode 444. Sequence ReconstructionCheck whether the original sequence org can be uniquely reconstructed from the sequences in seqs. The org sequence is a permutation of the integers from 1 to...
View Article[LeetCode]Smarking Algorithm Contest 2解题报告
Smarking Algorithm Contest 2是LeetCode举办的第十场正式周赛,共4道题目,比赛时长2.5小时。比赛链接:https://leetcode.com/contest/detail/11题解列表:LeetCode 435. Non-overlapping IntervalsLeetCode 436. Find Right IntervalLeetCode 441....
View Article[LeetCode]Find All Numbers Disappeared in an Array
题目描述:LeetCode 448. Find All Numbers Disappeared in an ArrayGiven an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of...
View Article[LeetCode]Serialize and Deserialize BST
题目描述:LeetCode 449. Serialize and Deserialize BSTSerialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or...
View Article[LeetCode]Sort Characters By Frequency
题目描述:LeetCode 451. Sort Characters By FrequencyGiven a string, sort it in decreasing order based on the frequency of characters.Example 1:Input:"tree"Output:"eert"Explanation:'e' appears twice while...
View Article