diff --git a/ctl/meta/Two_Pointers b/ctl/meta/Two_Pointers index b69b9859..2c238556 100644 --- a/ctl/meta/Two_Pointers +++ b/ctl/meta/Two_Pointers @@ -34,7 +34,7 @@ |713. Subarray Product Less Than K | [Go]({{< relref "/ChapterFour/0713.Subarray-Product-Less-Than-K.md" >}})| Medium | O(n)| O(1)|| |763. Partition Labels | [Go]({{< relref "/ChapterFour/0763.Partition-Labels.md" >}})| Medium | O(n)| O(1)|❤️| |826. Most Profit Assigning Work | [Go]({{< relref "/ChapterFour/0826.Most-Profit-Assigning-Work.md" >}})| Medium | O(n log n)| O(n)|| -|828. Unique Letter String | [Go]({{< relref "/ChapterFour/0828.COPYRIGHT-PROBLEM-XXX.md" >}})| Hard | O(n)| O(1)|❤️| +|828. Count Unique Characters of All Substrings of a Given String | [Go]({{< relref "/ChapterFour/0828.Count-Unique-Characters-of-All-Substrings-of-a-Given-String.md" >}})| Hard | O(n)| O(1)|❤️| |838. Push Dominoes | [Go]({{< relref "/ChapterFour/0838.Push-Dominoes.md" >}})| Medium | O(n)| O(n)|| |844. Backspace String Compare | [Go]({{< relref "/ChapterFour/0844.Backspace-String-Compare.md" >}})| Easy | O(n)| O(n) || |845. Longest Mountain in Array | [Go]({{< relref "/ChapterFour/0845.Longest-Mountain-in-Array.md" >}})| Medium | O(n)| O(1) || diff --git a/ctl/meta/Union_Find b/ctl/meta/Union_Find index b0bab407..66424cf4 100644 --- a/ctl/meta/Union_Find +++ b/ctl/meta/Union_Find @@ -2,7 +2,7 @@ |130. Surrounded Regions | [Go]({{< relref "/ChapterFour/0130.Surrounded-Regions.md" >}})| Medium | O(m\*n)| O(m\*n)|| |200. Number of Islands | [Go]({{< relref "/ChapterFour/0200.Number-of-Islands.md" >}})| Medium | O(m\*n)| O(m\*n)|| |399. Evaluate Division | [Go]({{< relref "/ChapterFour/0399.Evaluate-Division.md" >}})| Medium | O(n)| O(n)|| -|547. Friend Circles | [Go]({{< relref "/ChapterFour/0547.Friend-Circles.md" >}})| Medium | O(n^2)| O(n)|| +|547. Number of Provinces | [Go]({{< relref "/ChapterFour/0547.Number-of-Provinces.md" >}})| Medium | O(n^2)| O(n)|| |684. Redundant Connection | [Go]({{< relref "/ChapterFour/0684.Redundant-Connection.md" >}})| Medium | O(n)| O(n)|| |685. Redundant Connection II | [Go]({{< relref "/ChapterFour/0685.Redundant-Connection-II.md" >}})| Hard | O(n)| O(n)|| |721. Accounts Merge | [Go]({{< relref "/ChapterFour/0721.Accounts-Merge.md" >}})| Medium | O(n)| O(n)|❤️| diff --git a/ctl/models/tagproblem.go b/ctl/models/tagproblem.go index 0514fbfe..838bbd23 100644 --- a/ctl/models/tagproblem.go +++ b/ctl/models/tagproblem.go @@ -122,7 +122,14 @@ func GenerateTagMdRows(solutionIds []int, metaMap map[int]TagList, mdrows []Mdro tmp := TagList{} tmp.FrontendQuestionID = row.FrontendQuestionID tmp.QuestionTitle = row.QuestionTitle - tmp.SolutionPath = fmt.Sprintf("[Go]({{< relref \"/ChapterFour/%v.md\" >}})", fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), strings.Replace(row.QuestionTitle, " ", "-", -1))) + s1 := strings.Replace(row.QuestionTitle, " ", "-", -1) + s2 := strings.Replace(s1, "'", "", -1) + s3 := strings.Replace(s2, "%", "", -1) + s4 := strings.Replace(s3, "(", "", -1) + s5 := strings.Replace(s4, ")", "", -1) + s6 := strings.Replace(s5, ",", "", -1) + s7 := strings.Replace(s6, "?", "", -1) + tmp.SolutionPath = fmt.Sprintf("[Go]({{< relref \"/ChapterFour/%v.md\" >}})", fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7)) tmp.Acceptance = row.Acceptance tmp.Difficulty = row.Difficulty tmp.TimeComplexity = metaMap[int(row.FrontendQuestionID)].TimeComplexity diff --git a/ctl/render.go b/ctl/render.go index 549d1c38..1e474d79 100644 --- a/ctl/render.go +++ b/ctl/render.go @@ -152,7 +152,6 @@ func buildChapterTwo() { gr m.GraphQLResp questions []m.Question ) - for index, tag := range chapterTwoSlug { body := getTagProblemList(tag) // fmt.Printf("%v\n", string(body)) @@ -165,21 +164,19 @@ func buildChapterTwo() { mdrows := m.ConvertMdModelFromQuestions(questions) sort.Sort(m.SortByQuestionID(mdrows)) solutionIds, _ := util.LoadSolutionsDir() - // generateMdRows(solutionIds, mdrows) - tl, err := loadMetaData(fmt.Sprintf("./meta/%v", chapterTwoFileName[index])) if err != nil { fmt.Printf("err = %v\n", err) } tls := m.GenerateTagMdRows(solutionIds, tl, mdrows) //fmt.Printf("tls = %v\n", tls) - // // 按照模板渲染 README + // 按照模板渲染 README res, err := renderChapterTwo(fmt.Sprintf("./template/%v.md", chapterTwoFileName[index]), m.TagLists{TagLists: tls}) if err != nil { fmt.Println(err) return } - util.WriteFile(fmt.Sprintf("./%v.md", chapterTwoFileName[index]), res) + util.WriteFile(fmt.Sprintf("../website/content/ChapterTwo/%v.md", chapterTwoFileName[index]), res) } } diff --git a/leetcode/0211.Add-and-Search-Word---Data-structure-design/211. Add and Search Word - Data structure design.go b/leetcode/0211.Design-Add-and-Search-Words-Data-Structure/211. Design Add and Search Words Data Structure.go similarity index 100% rename from leetcode/0211.Add-and-Search-Word---Data-structure-design/211. Add and Search Word - Data structure design.go rename to leetcode/0211.Design-Add-and-Search-Words-Data-Structure/211. Design Add and Search Words Data Structure.go diff --git a/leetcode/0211.Add-and-Search-Word---Data-structure-design/211. Add and Search Word - Data structure design_test.go b/leetcode/0211.Design-Add-and-Search-Words-Data-Structure/211. Design Add and Search Words Data Structure_test.go similarity index 100% rename from leetcode/0211.Add-and-Search-Word---Data-structure-design/211. Add and Search Word - Data structure design_test.go rename to leetcode/0211.Design-Add-and-Search-Words-Data-Structure/211. Design Add and Search Words Data Structure_test.go diff --git a/leetcode/0211.Add-and-Search-Word---Data-structure-design/README.md b/leetcode/0211.Design-Add-and-Search-Words-Data-Structure/README.md similarity index 89% rename from leetcode/0211.Add-and-Search-Word---Data-structure-design/README.md rename to leetcode/0211.Design-Add-and-Search-Words-Data-Structure/README.md index 57f8c335..cc646b06 100755 --- a/leetcode/0211.Add-and-Search-Word---Data-structure-design/README.md +++ b/leetcode/0211.Design-Add-and-Search-Words-Data-Structure/README.md @@ -1,4 +1,4 @@ -# [211. Add and Search Word - Data structure design](https://leetcode.com/problems/add-and-search-word-data-structure-design/) +# [211. Design Add and Search Words Data Structure](https://leetcode.com/problems/design-add-and-search-words-data-structure/) ## 题目 diff --git a/website/content/ChapterFour/0211.Add-and-Search-Word---Data-structure-design.md b/website/content/ChapterFour/0211.Design-Add-and-Search-Words-Data-Structure.md similarity index 94% rename from website/content/ChapterFour/0211.Add-and-Search-Word---Data-structure-design.md rename to website/content/ChapterFour/0211.Design-Add-and-Search-Words-Data-Structure.md index ba8502f7..208903d5 100755 --- a/website/content/ChapterFour/0211.Add-and-Search-Word---Data-structure-design.md +++ b/website/content/ChapterFour/0211.Design-Add-and-Search-Words-Data-Structure.md @@ -1,4 +1,4 @@ -# [211. Add and Search Word - Data structure design](https://leetcode.com/problems/add-and-search-word-data-structure-design/) +# [211. Design Add and Search Words Data Structure](https://leetcode.com/problems/design-add-and-search-words-data-structure/) ## 题目 diff --git a/website/content/ChapterTwo/Array.md b/website/content/ChapterTwo/Array.md index dde8b937..fae2d630 100644 --- a/website/content/ChapterTwo/Array.md +++ b/website/content/ChapterTwo/Array.md @@ -76,7 +76,7 @@ type: docs |0566|Reshape the Matrix|[Go]({{< relref "/ChapterFour/0566.Reshape-the-Matrix.md" >}})|Easy| O(n^2)| O(n^2)||61.0%| |0605|Can Place Flowers|[Go]({{< relref "/ChapterFour/0605.Can-Place-Flowers.md" >}})|Easy||||31.9%| |0628|Maximum Product of Three Numbers|[Go]({{< relref "/ChapterFour/0628.Maximum-Product-of-Three-Numbers.md" >}})|Easy| O(n)| O(1)||47.0%| -|0661|Image Smoother|[Go]({{< relref "/ChapterFour/0661.Image-Smoother.md" >}})|Easy||||52.1%| +|0661|Image Smoother|[Go]({{< relref "/ChapterFour/0661.Image-Smoother.md" >}})|Easy||||52.2%| |0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0695.Max-Area-of-Island.md" >}})|Medium||||64.3%| |0697|Degree of an Array|[Go]({{< relref "/ChapterFour/0697.Degree-of-an-Array.md" >}})|Easy||||54.3%| |0713|Subarray Product Less Than K|[Go]({{< relref "/ChapterFour/0713.Subarray-Product-Less-Than-K.md" >}})|Medium| O(n)| O(1)||40.4%| @@ -87,7 +87,7 @@ type: docs |0724|Find Pivot Index|[Go]({{< relref "/ChapterFour/0724.Find-Pivot-Index.md" >}})|Easy||||45.0%| |0729|My Calendar I|[Go]({{< relref "/ChapterFour/0729.My-Calendar-I.md" >}})|Medium||||53.1%| |0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||50.9%| -|0766|Toeplitz Matrix|[Go]({{< relref "/ChapterFour/0766.Toeplitz-Matrix.md" >}})|Easy| O(n)| O(1)||65.8%| +|0766|Toeplitz Matrix|[Go]({{< relref "/ChapterFour/0766.Toeplitz-Matrix.md" >}})|Easy| O(n)| O(1)||65.7%| |0830|Positions of Large Groups|[Go]({{< relref "/ChapterFour/0830.Positions-of-Large-Groups.md" >}})|Easy||||50.2%| |0832|Flipping an Image|[Go]({{< relref "/ChapterFour/0832.Flipping-an-Image.md" >}})|Easy||||77.9%| |0867|Transpose Matrix|[Go]({{< relref "/ChapterFour/0867.Transpose-Matrix.md" >}})|Easy| O(n)| O(1)||62.2%| @@ -107,8 +107,8 @@ type: docs |1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||59.5%| |1018|Binary Prefix Divisible By 5|[Go]({{< relref "/ChapterFour/1018.Binary-Prefix-Divisible-By-5.md" >}})|Easy||||47.8%| |1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium||||54.0%| -|1051|Height Checker|[Go]({{< relref "/ChapterFour/1051.Height-Checker.md" >}})|Easy||||71.8%| -|1052|Grumpy Bookstore Owner|[Go]({{< relref "/ChapterFour/1052.Grumpy-Bookstore-Owner.md" >}})|Medium||||55.7%| +|1051|Height Checker|[Go]({{< relref "/ChapterFour/1051.Height-Checker.md" >}})|Easy||||71.9%| +|1052|Grumpy Bookstore Owner|[Go]({{< relref "/ChapterFour/1052.Grumpy-Bookstore-Owner.md" >}})|Medium||||55.6%| |1074|Number of Submatrices That Sum to Target|[Go]({{< relref "/ChapterFour/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})|Hard||||61.4%| |1089|Duplicate Zeros|[Go]({{< relref "/ChapterFour/1089.Duplicate-Zeros.md" >}})|Easy||||52.0%| |1122|Relative Sort Array|[Go]({{< relref "/ChapterFour/1122.Relative-Sort-Array.md" >}})|Easy||||67.7%| @@ -127,11 +127,11 @@ type: docs |1260|Shift 2D Grid|[Go]({{< relref "/ChapterFour/1260.Shift-2D-Grid.md" >}})|Easy||||61.8%| |1266|Minimum Time Visiting All Points|[Go]({{< relref "/ChapterFour/1266.Minimum-Time-Visiting-All-Points.md" >}})|Easy||||79.3%| |1275|Find Winner on a Tic Tac Toe Game|[Go]({{< relref "/ChapterFour/1275.Find-Winner-on-a-Tic-Tac-Toe-Game.md" >}})|Easy||||52.9%| -|1287|Element Appearing More Than 25% In Sorted Array|[Go]({{< relref "/ChapterFour/1287.Element-Appearing-More-Than-25%-In-Sorted-Array.md" >}})|Easy||||60.2%| +|1287|Element Appearing More Than 25% In Sorted Array|[Go]({{< relref "/ChapterFour/1287.Element-Appearing-More-Than-25-In-Sorted-Array.md" >}})|Easy||||60.2%| |1295|Find Numbers with Even Number of Digits|[Go]({{< relref "/ChapterFour/1295.Find-Numbers-with-Even-Number-of-Digits.md" >}})|Easy||||79.4%| |1299|Replace Elements with Greatest Element on Right Side|[Go]({{< relref "/ChapterFour/1299.Replace-Elements-with-Greatest-Element-on-Right-Side.md" >}})|Easy||||74.1%| |1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||43.3%| -|1304|Find N Unique Integers Sum up to Zero|[Go]({{< relref "/ChapterFour/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}})|Easy||||76.5%| +|1304|Find N Unique Integers Sum up to Zero|[Go]({{< relref "/ChapterFour/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}})|Easy||||76.6%| |1313|Decompress Run-Length Encoded List|[Go]({{< relref "/ChapterFour/1313.Decompress-Run-Length-Encoded-List.md" >}})|Easy||||85.3%| |1380|Lucky Numbers in a Matrix|[Go]({{< relref "/ChapterFour/1380.Lucky-Numbers-in-a-Matrix.md" >}})|Easy||||70.9%| |1385|Find the Distance Value Between Two Arrays|[Go]({{< relref "/ChapterFour/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}})|Easy||||66.4%| @@ -141,10 +141,11 @@ type: docs |1480|Running Sum of 1d Array|[Go]({{< relref "/ChapterFour/1480.Running-Sum-of-1d-Array.md" >}})|Easy||||89.6%| |1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.9%| |1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||55.3%| -|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||62.4%| -|1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||51.6%| +|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||62.3%| +|1646|Get Maximum in Generated Array|[Go]({{< relref "/ChapterFour/1646.Get-Maximum-in-Generated-Array.md" >}})|Easy||||52.3%| |1652|Defuse the Bomb|[Go]({{< relref "/ChapterFour/1652.Defuse-the-Bomb.md" >}})|Easy||||64.2%| -|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1656.Design-an-Ordered-Stream.md" >}})|Easy||||82.4%| +|1656|Design an Ordered Stream|[Go]({{< relref "/ChapterFour/1656.Design-an-Ordered-Stream.md" >}})|Easy||||82.5%| |1672|Richest Customer Wealth|[Go]({{< relref "/ChapterFour/1672.Richest-Customer-Wealth.md" >}})|Easy||||88.6%| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| + diff --git a/website/content/ChapterTwo/Backtracking.md b/website/content/ChapterTwo/Backtracking.md index 74f112a0..dd2cd9dc 100644 --- a/website/content/ChapterTwo/Backtracking.md +++ b/website/content/ChapterTwo/Backtracking.md @@ -97,36 +97,40 @@ func updateMatrix_BFS(matrix [][]int) [][]int { } ``` -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|17. Letter Combinations of a Phone Number | [Go]({{< relref "/ChapterFour/0017.Letter-Combinations-of-a-Phone-Number.md" >}})| Medium | O(log n)| O(1)|| -|22. Generate Parentheses| [Go]({{< relref "/ChapterFour/0022.Generate-Parentheses.md" >}})| Medium | O(log n)| O(1)|| -|37. Sudoku Solver | [Go]({{< relref "/ChapterFour/0037.Sudoku-Solver.md" >}})| Hard | O(n^2)| O(n^2)|❤️| -|39. Combination Sum | [Go]({{< relref "/ChapterFour/0039.Combination-Sum.md" >}})| Medium | O(n log n)| O(n)|| -|40. Combination Sum II | [Go]({{< relref "/ChapterFour/0040.Combination-Sum-II.md" >}})| Medium | O(n log n)| O(n)|| -|46. Permutations | [Go]({{< relref "/ChapterFour/0046.Permutations.md" >}})| Medium | O(n)| O(n)|❤️| -|47. Permutations II | [Go]({{< relref "/ChapterFour/0047.Permutations-II.md" >}})| Medium | O(n^2)| O(n)|❤️| -|51. N-Queens | [Go]({{< relref "/ChapterFour/0051.N-Queens.md" >}})| Hard | O(n^2)| O(n)|❤️| -|52. N-Queens II | [Go]({{< relref "/ChapterFour/0052.N-Queens-II.md" >}})| Hard | O(n^2)| O(n)|❤️| -|60. Permutation Sequence | [Go]({{< relref "/ChapterFour/0060.Permutation-Sequence.md" >}})| Medium | O(n log n)| O(1)|| -|77. Combinations | [Go]({{< relref "/ChapterFour/0077.Combinations.md" >}})| Medium | O(n)| O(n)|❤️| -|78. Subsets | [Go]({{< relref "/ChapterFour/0078.Subsets.md" >}})| Medium | O(n^2)| O(n)|❤️| -|79. Word Search | [Go]({{< relref "/ChapterFour/0079.Word-Search.md" >}})| Medium | O(n^2)| O(n^2)|❤️| -|89. Gray Codes | [Go]({{< relref "/ChapterFour/0089.Gray-Code.md" >}})| Medium | O(n)| O(1)|| -|90. Subsets II | [Go]({{< relref "/ChapterFour/0090.Subsets-II.md" >}})| Medium | O(n^2)| O(n)|❤️| -|93. Restore IP Addresses | [Go]({{< relref "/ChapterFour/0093.Restore-IP-Addresses.md" >}})| Medium | O(n)| O(n)|❤️| -|126. Word Ladder II | [Go]({{< relref "/ChapterFour/0126.Word-Ladder-II.md" >}})| Hard | O(n)| O(n^2)|❤️| -|131. Palindrome Partitioning | [Go]({{< relref "/ChapterFour/0131.Palindrome-Partitioning.md" >}})| Medium | O(n)| O(n^2)|❤️| -|211. Add and Search Word - Data structure design | [Go]({{< relref "/ChapterFour/0211.Add-and-Search-Word---Data-structure-design.md" >}})| Medium | O(n)| O(n)|❤️| -|212. Word Search II | [Go]({{< relref "/ChapterFour/0212.Word-Search-II.md" >}})| Hard | O(n^2)| O(n^2)|❤️| -|216. Combination Sum III | [Go]({{< relref "/ChapterFour/0216.Combination-Sum-III.md" >}})| Medium | O(n)| O(1)|❤️| -|306. Additive Number | [Go]({{< relref "/ChapterFour/0306.Additive-Number.md" >}})| Medium | O(n^2)| O(1)|❤️| -|357. Count Numbers with Unique Digits | [Go]({{< relref "/ChapterFour/0357.Count-Numbers-with-Unique-Digits.md" >}})| Medium | O(1)| O(1)|| -|401. Binary Watch | [Go]({{< relref "/ChapterFour/0401.Binary-Watch.md" >}})| Easy | O(1)| O(1)|| -|526. Beautiful Arrangement | [Go]({{< relref "/ChapterFour/0526.Beautiful-Arrangement.md" >}})| Medium | O(n^2)| O(1)|❤️| -|784. Letter Case Permutation | [Go]({{< relref "/ChapterFour/0784.Letter-Case-Permutation.md" >}})| Easy | O(n)| O(n)|| -|842. Split Array into Fibonacci Sequence | [Go]({{< relref "/ChapterFour/0842.Split-Array-into-Fibonacci-Sequence.md" >}})| Medium | O(n^2)| O(1)|❤️| -|980. Unique Paths III | [Go]({{< relref "/ChapterFour/0980.Unique-Paths-III.md" >}})| Hard | O(n log n)| O(n)|| -|996. Number of Squareful Arrays | [Go]({{< relref "/ChapterFour/0996.Number-of-Squareful-Arrays.md" >}})| Hard | O(n log n)| O(n) || -|1079. Letter Tile Possibilities | [Go]({{< relref "/ChapterFour/1079.Letter-Tile-Possibilities.md" >}})| Medium | O(n^2)| O(1)|❤️| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||48.6%| +|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0022.Generate-Parentheses.md" >}})|Medium| O(log n)| O(1)||64.8%| +|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|45.9%| +|0039|Combination Sum|[Go]({{< relref "/ChapterFour/0039.Combination-Sum.md" >}})|Medium| O(n log n)| O(n)||58.7%| +|0040|Combination Sum II|[Go]({{< relref "/ChapterFour/0040.Combination-Sum-II.md" >}})|Medium| O(n log n)| O(n)||49.8%| +|0046|Permutations|[Go]({{< relref "/ChapterFour/0046.Permutations.md" >}})|Medium| O(n)| O(n)|❤️|66.0%| +|0047|Permutations II|[Go]({{< relref "/ChapterFour/0047.Permutations-II.md" >}})|Medium| O(n^2)| O(n)|❤️|49.0%| +|0051|N-Queens|[Go]({{< relref "/ChapterFour/0051.N-Queens.md" >}})|Hard| O(n^2)| O(n)|❤️|49.0%| +|0052|N-Queens II|[Go]({{< relref "/ChapterFour/0052.N-Queens-II.md" >}})|Hard| O(n^2)| O(n)|❤️|59.7%| +|0060|Permutation Sequence|[Go]({{< relref "/ChapterFour/0060.Permutation-Sequence.md" >}})|Hard| O(n log n)| O(1)||39.2%| +|0077|Combinations|[Go]({{< relref "/ChapterFour/0077.Combinations.md" >}})|Medium| O(n)| O(n)|❤️|56.9%| +|0078|Subsets|[Go]({{< relref "/ChapterFour/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|64.5%| +|0079|Word Search|[Go]({{< relref "/ChapterFour/0079.Word-Search.md" >}})|Medium| O(n^2)| O(n^2)|❤️|36.6%| +|0089|Gray Code|[Go]({{< relref "/ChapterFour/0089.Gray-Code.md" >}})|Medium| O(n)| O(1)||50.1%| +|0090|Subsets II|[Go]({{< relref "/ChapterFour/0090.Subsets-II.md" >}})|Medium| O(n^2)| O(n)|❤️|48.5%| +|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|37.2%| +|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|23.4%| +|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0131.Palindrome-Partitioning.md" >}})|Medium| O(n)| O(n^2)|❤️|51.3%| +|0211|Design Add and Search Words Data Structure|[Go]({{< relref "/ChapterFour/0211.Design-Add-and-Search-Words-Data-Structure.md" >}})|Medium| O(n)| O(n)|❤️|39.8%| +|0212|Word Search II|[Go]({{< relref "/ChapterFour/0212.Word-Search-II.md" >}})|Hard| O(n^2)| O(n^2)|❤️|36.5%| +|0216|Combination Sum III|[Go]({{< relref "/ChapterFour/0216.Combination-Sum-III.md" >}})|Medium| O(n)| O(1)|❤️|59.9%| +|0306|Additive Number|[Go]({{< relref "/ChapterFour/0306.Additive-Number.md" >}})|Medium| O(n^2)| O(1)|❤️|29.6%| +|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||48.7%| +|0401|Binary Watch|[Go]({{< relref "/ChapterFour/0401.Binary-Watch.md" >}})|Easy| O(1)| O(1)||48.3%| +|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0526.Beautiful-Arrangement.md" >}})|Medium| O(n^2)| O(1)|❤️|61.7%| +|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(n)||66.2%| +|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|36.7%| +|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0980.Unique-Paths-III.md" >}})|Hard| O(n log n)| O(n)||77.1%| +|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0996.Number-of-Squareful-Arrays.md" >}})|Hard| O(n log n)| O(n) ||48.0%| +|1079|Letter Tile Possibilities|[Go]({{< relref "/ChapterFour/1079.Letter-Tile-Possibilities.md" >}})|Medium| O(n^2)| O(1)|❤️|75.8%| +|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.7%| +|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1659.Maximize-Grid-Happiness.md" >}})|Hard||||35.2%| +|1681|Minimum Incompatibility|[Go]({{< relref "/ChapterFour/1681.Minimum-Incompatibility.md" >}})|Hard||||35.0%| +|1688|Count of Matches in Tournament|[Go]({{< relref "/ChapterFour/1688.Count-of-Matches-in-Tournament.md" >}})|Easy||||83.2%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Binary_Indexed_Tree.md b/website/content/ChapterTwo/Binary_Indexed_Tree.md index 7fbc2dfc..9c722c1a 100644 --- a/website/content/ChapterTwo/Binary_Indexed_Tree.md +++ b/website/content/ChapterTwo/Binary_Indexed_Tree.md @@ -6,3 +6,13 @@ type: docs # Binary Indexed Tree ![](https://img.halfrost.com/Leetcode/Binary_Indexed_Tree.png) + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0218.The-Skyline-Problem.md" >}})|Hard||||36.1%| +|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0307.Range-Sum-Query---Mutable.md" >}})|Medium||||36.5%| +|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.6%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0327.Count-of-Range-Sum.md" >}})|Hard||||35.9%| +|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0493.Reverse-Pairs.md" >}})|Hard||||26.6%| +|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||36.2%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Binary_Search.md b/website/content/ChapterTwo/Binary_Search.md index 2c71c30d..7339fdc6 100644 --- a/website/content/ChapterTwo/Binary_Search.md +++ b/website/content/ChapterTwo/Binary_Search.md @@ -127,19 +127,74 @@ func peakIndexInMountainArray(A []int) int { - max-min 最大值最小化问题。求在最小满足条件的情况下的最大值。第 410 题,第 875 题,第 1011 题,第 1283 题。 -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|50. Pow(x, n) | [Go]({{< relref "/ChapterFour/0050.Powx-n.md" >}})| Medium | O(log n)| O(1)|| -|69. Sqrt(x) | [Go]({{< relref "/ChapterFour/0069.Sqrtx.md" >}})| Easy | O(log n)| O(1)|| -|167. Two Sum II - Input array is sorted | [Go]({{< relref "/ChapterFour/0167.Two-Sum-II---Input-array-is-sorted.md" >}})| Easy | O(n)| O(1)|| -|209. Minimum Size Subarray Sum | [Go]({{< relref "/ChapterFour/0209.Minimum-Size-Subarray-Sum.md" >}})| Medium | O(n)| O(1)|| -|222. Count Complete Tree Nodes | [Go]({{< relref "/ChapterFour/0222.Count-Complete-Tree-Nodes.md" >}})| Medium | O(n)| O(1)|| -|230. Kth Smallest Element in a BST | [Go]({{< relref "/ChapterFour/0230.Kth-Smallest-Element-in-a-BST.md" >}})| Medium | O(n)| O(1)|| -|287. Find the Duplicate Number | [Go]({{< relref "/ChapterFour/0287.Find-the-Duplicate-Number.md" >}})| Easy | O(n)| O(1)|❤️| -|300. Longest Increasing Subsequence | [Go]({{< relref "/ChapterFour/0300.Longest-Increasing-Subsequence.md" >}})| Medium | O(n log n)| O(n)|| -|349. Intersection of Two Arrays | [Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})| Easy | O(n)| O(n) || -|350. Intersection of Two Arrays II | [Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})| Easy | O(n)| O(n) || -|392. Is Subsequence | [Go]({{< relref "/ChapterFour/0392.Is-Subsequence.md" >}})| Medium | O(n)| O(1)|| -|454. 4Sum II | [Go]({{< relref "/ChapterFour/0454.4Sum-II.md" >}})| Medium | O(n^2)| O(n) || -|710. Random Pick with Blacklist | [Go]({{< relref "/ChapterFour/0710.Random-Pick-with-Blacklist.md" >}})| Hard | O(n)| O(n) || -|-----------------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0004|Median of Two Sorted Arrays|[Go]({{< relref "/ChapterFour/0004.Median-of-Two-Sorted-Arrays.md" >}})|Hard||||30.8%| +|0029|Divide Two Integers|[Go]({{< relref "/ChapterFour/0029.Divide-Two-Integers.md" >}})|Medium||||16.6%| +|0033|Search in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0033.Search-in-Rotated-Sorted-Array.md" >}})|Medium||||35.6%| +|0034|Find First and Last Position of Element in Sorted Array|[Go]({{< relref "/ChapterFour/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array.md" >}})|Medium||||37.1%| +|0035|Search Insert Position|[Go]({{< relref "/ChapterFour/0035.Search-Insert-Position.md" >}})|Easy||||42.8%| +|0050|Pow(x, n)|[Go]({{< relref "/ChapterFour/0050.Powx-n.md" >}})|Medium| O(log n)| O(1)||30.8%| +|0069|Sqrt(x)|[Go]({{< relref "/ChapterFour/0069.Sqrtx.md" >}})|Easy| O(log n)| O(1)||34.8%| +|0074|Search a 2D Matrix|[Go]({{< relref "/ChapterFour/0074.Search-a-2D-Matrix.md" >}})|Medium||||37.4%| +|0081|Search in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0081.Search-in-Rotated-Sorted-Array-II.md" >}})|Medium||||33.5%| +|0153|Find Minimum in Rotated Sorted Array|[Go]({{< relref "/ChapterFour/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}})|Medium||||45.9%| +|0154|Find Minimum in Rotated Sorted Array II|[Go]({{< relref "/ChapterFour/0154.Find-Minimum-in-Rotated-Sorted-Array-II.md" >}})|Hard||||41.9%| +|0162|Find Peak Element|[Go]({{< relref "/ChapterFour/0162.Find-Peak-Element.md" >}})|Medium||||43.8%| +|0167|Two Sum II - Input array is sorted|[Go]({{< relref "/ChapterFour/0167.Two-Sum-II---Input-array-is-sorted.md" >}})|Easy| O(n)| O(1)||55.4%| +|0174|Dungeon Game|[Go]({{< relref "/ChapterFour/0174.Dungeon-Game.md" >}})|Hard||||33.1%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.2%| +|0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0222.Count-Complete-Tree-Nodes.md" >}})|Medium| O(n)| O(1)||48.8%| +|0230|Kth Smallest Element in a BST|[Go]({{< relref "/ChapterFour/0230.Kth-Smallest-Element-in-a-BST.md" >}})|Medium| O(n)| O(1)||62.1%| +|0240|Search a 2D Matrix II|[Go]({{< relref "/ChapterFour/0240.Search-a-2D-Matrix-II.md" >}})|Medium||||44.1%| +|0275|H-Index II|[Go]({{< relref "/ChapterFour/0275.H-Index-II.md" >}})|Medium||||36.2%| +|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|57.1%| +|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||43.6%| +|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.6%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0327.Count-of-Range-Sum.md" >}})|Hard||||35.9%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.4%| +|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||51.9%| +|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0354.Russian-Doll-Envelopes.md" >}})|Hard||||36.1%| +|0367|Valid Perfect Square|[Go]({{< relref "/ChapterFour/0367.Valid-Perfect-Square.md" >}})|Easy||||42.0%| +|0378|Kth Smallest Element in a Sorted Matrix|[Go]({{< relref "/ChapterFour/0378.Kth-Smallest-Element-in-a-Sorted-Matrix.md" >}})|Medium||||55.8%| +|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0392.Is-Subsequence.md" >}})|Easy| O(n)| O(1)||49.5%| +|0410|Split Array Largest Sum|[Go]({{< relref "/ChapterFour/0410.Split-Array-Largest-Sum.md" >}})|Hard||||46.1%| +|0436|Find Right Interval|[Go]({{< relref "/ChapterFour/0436.Find-Right-Interval.md" >}})|Medium||||48.4%| +|0441|Arranging Coins|[Go]({{< relref "/ChapterFour/0441.Arranging-Coins.md" >}})|Easy||||42.3%| +|0454|4Sum II|[Go]({{< relref "/ChapterFour/0454.4Sum-II.md" >}})|Medium| O(n^2)| O(n) ||54.5%| +|0475|Heaters|[Go]({{< relref "/ChapterFour/0475.Heaters.md" >}})|Medium||||33.5%| +|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0483.Smallest-Good-Base.md" >}})|Hard||||36.2%| +|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0493.Reverse-Pairs.md" >}})|Hard||||26.6%| +|0497|Random Point in Non-overlapping Rectangles|[Go]({{< relref "/ChapterFour/0497.Random-Point-in-Non-overlapping-Rectangles.md" >}})|Medium||||39.1%| +|0528|Random Pick with Weight|[Go]({{< relref "/ChapterFour/0528.Random-Pick-with-Weight.md" >}})|Medium||||44.5%| +|0658|Find K Closest Elements|[Go]({{< relref "/ChapterFour/0658.Find-K-Closest-Elements.md" >}})|Medium||||41.7%| +|0668|Kth Smallest Number in Multiplication Table|[Go]({{< relref "/ChapterFour/0668.Kth-Smallest-Number-in-Multiplication-Table.md" >}})|Hard||||47.6%| +|0704|Binary Search|[Go]({{< relref "/ChapterFour/0704.Binary-Search.md" >}})|Easy||||54.0%| +|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||32.7%| +|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||50.1%| +|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||32.5%| +|0744|Find Smallest Letter Greater Than Target|[Go]({{< relref "/ChapterFour/0744.Find-Smallest-Letter-Greater-Than-Target.md" >}})|Easy||||45.6%| +|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0778.Swim-in-Rising-Water.md" >}})|Hard||||54.4%| +|0786|K-th Smallest Prime Fraction|[Go]({{< relref "/ChapterFour/0786.K-th-Smallest-Prime-Fraction.md" >}})|Hard||||41.7%| +|0793|Preimage Size of Factorial Zeroes Function|[Go]({{< relref "/ChapterFour/0793.Preimage-Size-of-Factorial-Zeroes-Function.md" >}})|Hard||||40.6%| +|0852|Peak Index in a Mountain Array|[Go]({{< relref "/ChapterFour/0852.Peak-Index-in-a-Mountain-Array.md" >}})|Easy||||71.8%| +|0862|Shortest Subarray with Sum at Least K|[Go]({{< relref "/ChapterFour/0862.Shortest-Subarray-with-Sum-at-Least-K.md" >}})|Hard||||25.1%| +|0875|Koko Eating Bananas|[Go]({{< relref "/ChapterFour/0875.Koko-Eating-Bananas.md" >}})|Medium||||53.4%| +|0878|Nth Magical Number|[Go]({{< relref "/ChapterFour/0878.Nth-Magical-Number.md" >}})|Hard||||28.9%| +|0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0887.Super-Egg-Drop.md" >}})|Hard||||27.0%| +|0911|Online Election|[Go]({{< relref "/ChapterFour/0911.Online-Election.md" >}})|Medium||||51.2%| +|0927|Three Equal Parts|[Go]({{< relref "/ChapterFour/0927.Three-Equal-Parts.md" >}})|Hard||||34.5%| +|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||53.9%| +|1011|Capacity To Ship Packages Within D Days|[Go]({{< relref "/ChapterFour/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}})|Medium||||59.5%| +|1111|Maximum Nesting Depth of Two Valid Parentheses Strings|[Go]({{< relref "/ChapterFour/1111.Maximum-Nesting-Depth-of-Two-Valid-Parentheses-Strings.md" >}})|Medium||||72.4%| +|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard||||39.5%| +|1201|Ugly Number III|[Go]({{< relref "/ChapterFour/1201.Ugly-Number-III.md" >}})|Medium||||26.3%| +|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||46.9%| +|1283|Find the Smallest Divisor Given a Threshold|[Go]({{< relref "/ChapterFour/1283.Find-the-Smallest-Divisor-Given-a-Threshold.md" >}})|Medium||||49.2%| +|1300|Sum of Mutated Array Closest to Target|[Go]({{< relref "/ChapterFour/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}})|Medium||||43.3%| +|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||36.2%| +|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.6%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| + +--| diff --git a/website/content/ChapterTwo/Bit_Manipulation.md b/website/content/ChapterTwo/Bit_Manipulation.md index 4dbc8705..c86d5963 100644 --- a/website/content/ChapterTwo/Bit_Manipulation.md +++ b/website/content/ChapterTwo/Bit_Manipulation.md @@ -40,35 +40,37 @@ X & ~X = 0 ``` -| Title | Solution | Difficulty | Time | Space | 收藏 | -| ----- | :--------: | :----------: | :----: | :-----: |:-----: | -|78. Subsets | [Go]({{< relref "/ChapterFour/0078.Subsets.md" >}})| Medium | O(n^2)| O(n)|❤️| -|136. Single Number | [Go]({{< relref "/ChapterFour/0136.Single-Number.md" >}})| Easy | O(n)| O(1)|| -|137. Single Number II | [Go]({{< relref "/ChapterFour/0137.Single-Number-II.md" >}})| Medium | O(n)| O(1)|❤️| -|169. Majority Element | [Go]({{< relref "/ChapterFour/0169.Majority-Element.md" >}})| Easy | O(n)| O(1)|❤️| -|187. Repeated DNA Sequences | [Go]({{< relref "/ChapterFour/0187.Repeated-DNA-Sequences.md" >}})| Medium | O(n)| O(1)|| -|190. Reverse Bits | [Go]({{< relref "/ChapterFour/0190.Reverse-Bits.md" >}})| Easy | O(n)| O(1)|❤️| -|191. Number of 1 Bits | [Go]({{< relref "/ChapterFour/0191.Number-of-1-Bits.md" >}})| Easy | O(n)| O(1)|| -|201. Bitwise AND of Numbers Range | [Go]({{< relref "/ChapterFour/0201.Bitwise-AND-of-Numbers-Range.md" >}})| Medium | O(n)| O(1)|❤️| -|231. Power of Two | [Go]({{< relref "/ChapterFour/0231.Power-of-Two.md" >}})| Easy | O(1)| O(1)|| -|260. Single Number III | [Go]({{< relref "/ChapterFour/0260.Single-Number-III.md" >}})| Medium | O(n)| O(1)|❤️| -|268. Missing Number | [Go]({{< relref "/ChapterFour/0268.Missing-Number.md" >}})| Easy | O(n)| O(1)|| -|318. Maximum Product of Word Lengths | [Go]({{< relref "/ChapterFour/0318.Maximum-Product-of-Word-Lengths.md" >}})| Medium | O(n)| O(1)|| -|338. Counting Bits | [Go]({{< relref "/ChapterFour/0338.Counting-Bits.md" >}})| Medium | O(n)| O(n)|| -|342. Power of Four | [Go]({{< relref "/ChapterFour/0342.Power-of-Four.md" >}})| Easy | O(n)| O(1)|| -|371. Sum of Two Integers | [Go]({{< relref "/ChapterFour/0371.Sum-of-Two-Integers.md" >}})| Easy | O(n)| O(1)|| -|389. Find the Difference | [Go]({{< relref "/ChapterFour/0389.Find-the-Difference.md" >}})| Easy | O(n)| O(1)|| -|393. UTF-8 Validation | [Go]({{< relref "/ChapterFour/0393.UTF-8-Validation.md" >}})| Medium | O(n)| O(1)|| -|397. Integer Replacement | [Go]({{< relref "/ChapterFour/0397.Integer-Replacement.md" >}})| Medium | O(n)| O(1)|| -|401. Binary Watch | [Go]({{< relref "/ChapterFour/0401.Binary-Watch.md" >}})| Easy | O(1)| O(1)|| -|405. Convert a Number to Hexadecimal | [Go]({{< relref "/ChapterFour/0405.Convert-a-Number-to-Hexadecimal.md" >}})| Easy | O(n)| O(1)|| -|421. Maximum XOR of Two Numbers in an Array | [Go]({{< relref "/ChapterFour/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md" >}})| Medium | O(n)| O(1)|❤️| -|461. Hamming Distance | [Go]({{< relref "/ChapterFour/0461.Hamming-Distance.md" >}})| Easy | O(n)| O(1)|| -|476. Number Complement | [Go]({{< relref "/ChapterFour/0476.Number-Complement.md" >}})| Easy | O(n)| O(1)|| -|477. Total Hamming Distance | [Go]({{< relref "/ChapterFour/0477.Total-Hamming-Distance.md" >}})| Medium | O(n)| O(1)|| -|693. Binary Number with Alternating Bits | [Go]({{< relref "/ChapterFour/0693.Binary-Number-with-Alternating-Bits.md" >}})| Easy | O(n)| O(1)|❤️| -|756. Pyramid Transition Matrix | [Go]({{< relref "/ChapterFour/0756.Pyramid-Transition-Matrix.md" >}})| Medium | O(n log n)| O(n)|| -|762. Prime Number of Set Bits in Binary Representation | [Go]({{< relref "/ChapterFour/0762.Prime-Number-of-Set-Bits-in-Binary-Representation.md" >}})| Easy | O(n)| O(1)|| -|784. Letter Case Permutation | [Go]({{< relref "/ChapterFour/0784.Letter-Case-Permutation.md" >}})| Easy | O(n)| O(1)|| -|898. Bitwise ORs of Subarrays | [Go]({{< relref "/ChapterFour/0898.Bitwise-ORs-of-Subarrays.md" >}})| Medium | O(n)| O(1)|| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0078|Subsets|[Go]({{< relref "/ChapterFour/0078.Subsets.md" >}})|Medium| O(n^2)| O(n)|❤️|64.5%| +|0136|Single Number|[Go]({{< relref "/ChapterFour/0136.Single-Number.md" >}})|Easy| O(n)| O(1)||66.4%| +|0137|Single Number II|[Go]({{< relref "/ChapterFour/0137.Single-Number-II.md" >}})|Medium| O(n)| O(1)|❤️|53.5%| +|0169|Majority Element|[Go]({{< relref "/ChapterFour/0169.Majority-Element.md" >}})|Easy| O(n)| O(1)|❤️|59.8%| +|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0187.Repeated-DNA-Sequences.md" >}})|Medium| O(n)| O(1)||41.2%| +|0190|Reverse Bits|[Go]({{< relref "/ChapterFour/0190.Reverse-Bits.md" >}})|Easy| O(n)| O(1)|❤️|41.6%| +|0191|Number of 1 Bits|[Go]({{< relref "/ChapterFour/0191.Number-of-1-Bits.md" >}})|Easy| O(n)| O(1)||51.9%| +|0201|Bitwise AND of Numbers Range|[Go]({{< relref "/ChapterFour/0201.Bitwise-AND-of-Numbers-Range.md" >}})|Medium| O(n)| O(1)|❤️|39.6%| +|0231|Power of Two|[Go]({{< relref "/ChapterFour/0231.Power-of-Two.md" >}})|Easy| O(1)| O(1)||43.8%| +|0260|Single Number III|[Go]({{< relref "/ChapterFour/0260.Single-Number-III.md" >}})|Medium| O(n)| O(1)|❤️|65.2%| +|0268|Missing Number|[Go]({{< relref "/ChapterFour/0268.Missing-Number.md" >}})|Easy| O(n)| O(1)||53.4%| +|0318|Maximum Product of Word Lengths|[Go]({{< relref "/ChapterFour/0318.Maximum-Product-of-Word-Lengths.md" >}})|Medium| O(n)| O(1)||52.0%| +|0338|Counting Bits|[Go]({{< relref "/ChapterFour/0338.Counting-Bits.md" >}})|Medium| O(n)| O(n)||70.2%| +|0342|Power of Four|[Go]({{< relref "/ChapterFour/0342.Power-of-Four.md" >}})|Easy| O(n)| O(1)||41.6%| +|0371|Sum of Two Integers|[Go]({{< relref "/ChapterFour/0371.Sum-of-Two-Integers.md" >}})|Medium| O(n)| O(1)||50.6%| +|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0389.Find-the-Difference.md" >}})|Easy| O(n)| O(1)||57.7%| +|0393|UTF-8 Validation|[Go]({{< relref "/ChapterFour/0393.UTF-8-Validation.md" >}})|Medium| O(n)| O(1)||37.9%| +|0397|Integer Replacement|[Go]({{< relref "/ChapterFour/0397.Integer-Replacement.md" >}})|Medium| O(n)| O(1)||33.4%| +|0401|Binary Watch|[Go]({{< relref "/ChapterFour/0401.Binary-Watch.md" >}})|Easy| O(1)| O(1)||48.3%| +|0405|Convert a Number to Hexadecimal|[Go]({{< relref "/ChapterFour/0405.Convert-a-Number-to-Hexadecimal.md" >}})|Easy| O(n)| O(1)||44.3%| +|0421|Maximum XOR of Two Numbers in an Array|[Go]({{< relref "/ChapterFour/0421.Maximum-XOR-of-Two-Numbers-in-an-Array.md" >}})|Medium| O(n)| O(1)|❤️|53.9%| +|0461|Hamming Distance|[Go]({{< relref "/ChapterFour/0461.Hamming-Distance.md" >}})|Easy| O(n)| O(1)||73.1%| +|0476|Number Complement|[Go]({{< relref "/ChapterFour/0476.Number-Complement.md" >}})|Easy| O(n)| O(1)||65.1%| +|0477|Total Hamming Distance|[Go]({{< relref "/ChapterFour/0477.Total-Hamming-Distance.md" >}})|Medium| O(n)| O(1)||50.6%| +|0693|Binary Number with Alternating Bits|[Go]({{< relref "/ChapterFour/0693.Binary-Number-with-Alternating-Bits.md" >}})|Easy| O(n)| O(1)|❤️|59.7%| +|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0756.Pyramid-Transition-Matrix.md" >}})|Medium| O(n log n)| O(n)||55.5%| +|0762|Prime Number of Set Bits in Binary Representation|[Go]({{< relref "/ChapterFour/0762.Prime-Number-of-Set-Bits-in-Binary-Representation.md" >}})|Easy| O(n)| O(1)||64.1%| +|0784|Letter Case Permutation|[Go]({{< relref "/ChapterFour/0784.Letter-Case-Permutation.md" >}})|Medium| O(n)| O(1)||66.2%| +|0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium| O(n)| O(1)||34.0%| +|1290|Convert Binary Number in a Linked List to Integer|[Go]({{< relref "/ChapterFour/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})|Easy||||81.6%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Breadth_First_Search.md b/website/content/ChapterTwo/Breadth_First_Search.md index f5ff7c73..eec61d7d 100644 --- a/website/content/ChapterTwo/Breadth_First_Search.md +++ b/website/content/ChapterTwo/Breadth_First_Search.md @@ -5,20 +5,31 @@ type: docs # Breadth First Search -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|101. Symmetric Tree | [Go]({{< relref "/ChapterFour/0101.Symmetric-Tree.md" >}})| Easy | O(n)| O(1)|| -|102. Binary Tree Level Order Traversal | [Go]({{< relref "/ChapterFour/0102.Binary-Tree-Level-Order-Traversal.md" >}})| Medium | O(n)| O(1)|| -|103. Binary Tree Zigzag Level Order Traversal | [Go]({{< relref "/ChapterFour/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})| Medium | O(n)| O(n)|| -|107. Binary Tree Level Order Traversal II | [Go]({{< relref "/ChapterFour/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})| Easy | O(n)| O(1)|| -|111. Minimum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0111.Minimum-Depth-of-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|126. Word Ladder II | [Go]({{< relref "/ChapterFour/0126.Word-Ladder-II.md" >}})| Hard | O(n)| O(n^2)|❤️| -|127. Word Ladder | [Go]({{< relref "/ChapterFour/0127.Word-Ladder.md" >}})| Medium | O(n)| O(n)|| -|199. Binary Tree Right Side View | [Go]({{< relref "/ChapterFour/0199.Binary-Tree-Right-Side-View.md" >}})| Medium | O(n)| O(1)|| -|200. Number of Islands | [Go]({{< relref "/ChapterFour/0200.Number-of-Islands.md" >}})| Medium | O(n^2)| O(n^2)|| -|207. Course Schedule | [Go]({{< relref "/ChapterFour/0207.Course-Schedule.md" >}})| Medium | O(n^2)| O(n^2)|| -|210. Course Schedule II | [Go]({{< relref "/ChapterFour/0210.Course-Schedule-II.md" >}})| Medium | O(n^2)| O(n^2)|| -|515. Find Largest Value in Each Tree Row | [Go]({{< relref "/ChapterFour/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})| Medium | O(n)| O(n)|| -|542. 01 Matrix | [Go]({{< relref "/ChapterFour/0542.01-Matrix.md" >}})| Medium | O(n)| O(1)|| -|993. Cousins in Binary Tree | [Go]({{< relref "/ChapterFour/0993.Cousins-in-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||47.9%| +|0102|Binary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0102.Binary-Tree-Level-Order-Traversal.md" >}})|Medium| O(n)| O(1)||56.2%| +|0103|Binary Tree Zigzag Level Order Traversal|[Go]({{< relref "/ChapterFour/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})|Medium| O(n)| O(n)||49.8%| +|0107|Binary Tree Level Order Traversal II|[Go]({{< relref "/ChapterFour/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})|Easy| O(n)| O(1)||54.8%| +|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||39.2%| +|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|23.4%| +|0127|Word Ladder|[Go]({{< relref "/ChapterFour/0127.Word-Ladder.md" >}})|Hard| O(n)| O(n)||31.5%| +|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0130.Surrounded-Regions.md" >}})|Medium||||29.2%| +|0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||55.7%| +|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200.Number-of-Islands.md" >}})|Medium| O(n^2)| O(n^2)||48.6%| +|0207|Course Schedule|[Go]({{< relref "/ChapterFour/0207.Course-Schedule.md" >}})|Medium| O(n^2)| O(n^2)||44.2%| +|0210|Course Schedule II|[Go]({{< relref "/ChapterFour/0210.Course-Schedule-II.md" >}})|Medium| O(n^2)| O(n^2)||42.2%| +|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.3%| +|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||62.0%| +|0529|Minesweeper|[Go]({{< relref "/ChapterFour/0529.Minesweeper.md" >}})|Medium||||60.7%| +|0542|01 Matrix|[Go]({{< relref "/ChapterFour/0542.01-Matrix.md" >}})|Medium| O(n)| O(1)||40.6%| +|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0785.Is-Graph-Bipartite.md" >}})|Medium||||48.2%| +|0815|Bus Routes|[Go]({{< relref "/ChapterFour/0815.Bus-Routes.md" >}})|Hard||||43.2%| +|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||57.5%| +|0864|Shortest Path to Get All Keys|[Go]({{< relref "/ChapterFour/0864.Shortest-Path-to-Get-All-Keys.md" >}})|Hard||||41.5%| +|0993|Cousins in Binary Tree|[Go]({{< relref "/ChapterFour/0993.Cousins-in-Binary-Tree.md" >}})|Easy| O(n)| O(1)||52.2%| +|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1306.Jump-Game-III.md" >}})|Medium||||62.6%| +|1654|Minimum Jumps to Reach Home|[Go]({{< relref "/ChapterFour/1654.Minimum-Jumps-to-Reach-Home.md" >}})|Medium||||26.4%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| + diff --git a/website/content/ChapterTwo/Depth_First_Search.md b/website/content/ChapterTwo/Depth_First_Search.md index 41d8ac37..78a8554c 100644 --- a/website/content/ChapterTwo/Depth_First_Search.md +++ b/website/content/ChapterTwo/Depth_First_Search.md @@ -5,29 +5,78 @@ type: docs # Depth First Search -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|98. Validate Binary Search Tree | [Go]({{< relref "/ChapterFour/0098.Validate-Binary-Search-Tree.md" >}})| Medium | O(n)| O(1)|| -|99. Recover Binary Search Tree | [Go]({{< relref "/ChapterFour/0099.Recover-Binary-Search-Tree.md" >}})| Hard | O(n)| O(1)|| -|100. Same Tree | [Go]({{< relref "/ChapterFour/0100.Same-Tree.md" >}})| Easy | O(n)| O(1)|| -|101. Symmetric Tree | [Go]({{< relref "/ChapterFour/0101.Symmetric-Tree.md" >}})| Easy | O(n)| O(1)|| -|104. Maximum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0104.Maximum-Depth-of-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|108. Convert Sorted Array to Binary Search Tree | [Go]({{< relref "/ChapterFour/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})| Easy | O(n)| O(1)|| -|109. Convert Sorted List to Binary Search Tree | [Go]({{< relref "/ChapterFour/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})| Medium | O(log n)| O(n)|| -|110. Balanced Binary Tree | [Go]({{< relref "/ChapterFour/0110.Balanced-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|111. Minimum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0111.Minimum-Depth-of-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|112. Path Sum | [Go]({{< relref "/ChapterFour/0112.Path-Sum.md" >}})| Easy | O(n)| O(1)|| -|113. Path Sum II | [Go]({{< relref "/ChapterFour/0113.Path-Sum-II.md" >}})| Medium | O(n)| O(1)|| -|114. Flatten Binary Tree to Linked List | [Go]({{< relref "/ChapterFour/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})| Medium | O(n)| O(1)|| -|124. Binary Tree Maximum Path Sum | [Go]({{< relref "/ChapterFour/0124.Binary-Tree-Maximum-Path-Sum.md" >}})| Hard | O(n)| O(1)|| -|129. Sum Root to Leaf Numbers | [Go]({{< relref "/ChapterFour/0129.Sum-Root-to-Leaf-Numbers.md" >}})| Medium | O(n)| O(1)|| -|199. Binary Tree Right Side View | [Go]({{< relref "/ChapterFour/0199.Binary-Tree-Right-Side-View.md" >}})| Medium | O(n)| O(1)|| -|200. Number of Islands | [Go]({{< relref "/ChapterFour/0200.Number-of-Islands.md" >}})| Medium | O(n^2)| O(n^2)|| -|207. Course Schedule | [Go]({{< relref "/ChapterFour/0207.Course-Schedule.md" >}})| Medium | O(n^2)| O(n^2)|| -|210. Course Schedule II | [Go]({{< relref "/ChapterFour/0210.Course-Schedule-II.md" >}})| Medium | O(n^2)| O(n^2)|| -|257. Binary Tree Paths | [Go]({{< relref "/ChapterFour/0257.Binary-Tree-Paths.md" >}})| Easy | O(n)| O(1)|| -|394. Decode String | [Go]({{< relref "/ChapterFour/0394.Decode-String.md" >}})| Medium | O(n)| O(n)|| -|515. Find Largest Value in Each Tree Row | [Go]({{< relref "/ChapterFour/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})| Medium | O(n)| O(n)|| -|542. 01 Matrix | [Go]({{< relref "/ChapterFour/0542.01-Matrix.md" >}})| Medium | O(n)| O(1)|| -|980. Unique Paths III | [Go]({{< relref "/ChapterFour/0980.Unique-Paths-III.md" >}})| Hard | O(n log n)| O(n)|| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium||||48.6%| +|0098|Validate Binary Search Tree|[Go]({{< relref "/ChapterFour/0098.Validate-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||28.6%| +|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0099.Recover-Binary-Search-Tree.md" >}})|Hard| O(n)| O(1)||42.1%| +|0100|Same Tree|[Go]({{< relref "/ChapterFour/0100.Same-Tree.md" >}})|Easy| O(n)| O(1)||54.0%| +|0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||47.9%| +|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||67.7%| +|0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go]({{< relref "/ChapterFour/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}})|Medium||||51.2%| +|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||49.1%| +|0108|Convert Sorted Array to Binary Search Tree|[Go]({{< relref "/ChapterFour/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})|Easy| O(n)| O(1)||59.9%| +|0109|Convert Sorted List to Binary Search Tree|[Go]({{< relref "/ChapterFour/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})|Medium| O(log n)| O(n)||49.8%| +|0110|Balanced Binary Tree|[Go]({{< relref "/ChapterFour/0110.Balanced-Binary-Tree.md" >}})|Easy| O(n)| O(1)||44.6%| +|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||39.2%| +|0112|Path Sum|[Go]({{< relref "/ChapterFour/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||42.1%| +|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||48.6%| +|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||51.4%| +|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||35.2%| +|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||50.6%| +|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0130.Surrounded-Regions.md" >}})|Medium||||29.2%| +|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0131.Palindrome-Partitioning.md" >}})|Medium||||51.3%| +|0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||55.7%| +|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200.Number-of-Islands.md" >}})|Medium| O(n^2)| O(n^2)||48.6%| +|0207|Course Schedule|[Go]({{< relref "/ChapterFour/0207.Course-Schedule.md" >}})|Medium| O(n^2)| O(n^2)||44.2%| +|0210|Course Schedule II|[Go]({{< relref "/ChapterFour/0210.Course-Schedule-II.md" >}})|Medium| O(n^2)| O(n^2)||42.2%| +|0211|Design Add and Search Words Data Structure|[Go]({{< relref "/ChapterFour/0211.Design-Add-and-Search-Words-Data-Structure.md" >}})|Medium||||39.8%| +|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0257.Binary-Tree-Paths.md" >}})|Easy| O(n)| O(1)||53.2%| +|0329|Longest Increasing Path in a Matrix|[Go]({{< relref "/ChapterFour/0329.Longest-Increasing-Path-in-a-Matrix.md" >}})|Hard||||44.4%| +|0337|House Robber III|[Go]({{< relref "/ChapterFour/0337.House-Robber-III.md" >}})|Medium||||51.7%| +|0394|Decode String|[Go]({{< relref "/ChapterFour/0394.Decode-String.md" >}})|Medium| O(n)| O(n)||52.3%| +|0491|Increasing Subsequences|[Go]({{< relref "/ChapterFour/0491.Increasing-Subsequences.md" >}})|Medium||||47.3%| +|0494|Target Sum|[Go]({{< relref "/ChapterFour/0494.Target-Sum.md" >}})|Medium||||45.9%| +|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.3%| +|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||62.0%| +|0526|Beautiful Arrangement|[Go]({{< relref "/ChapterFour/0526.Beautiful-Arrangement.md" >}})|Medium||||61.7%| +|0529|Minesweeper|[Go]({{< relref "/ChapterFour/0529.Minesweeper.md" >}})|Medium||||60.7%| +|0542|01 Matrix|[Go]({{< relref "/ChapterFour/0542.01-Matrix.md" >}})|Medium| O(n)| O(1)||40.6%| +|0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0547.Number-of-Provinces.md" >}})|Medium||||60.1%| +|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0563.Binary-Tree-Tilt.md" >}})|Easy||||52.6%| +|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0638.Shopping-Offers.md" >}})|Medium||||52.5%| +|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0685.Redundant-Connection-II.md" >}})|Hard||||32.9%| +|0695|Max Area of Island|[Go]({{< relref "/ChapterFour/0695.Max-Area-of-Island.md" >}})|Medium||||64.3%| +|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0721.Accounts-Merge.md" >}})|Medium||||51.2%| +|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0733.Flood-Fill.md" >}})|Easy||||55.8%| +|0753|Cracking the Safe|[Go]({{< relref "/ChapterFour/0753.Cracking-the-Safe.md" >}})|Hard||||52.0%| +|0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||55.5%| +|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0778.Swim-in-Rising-Water.md" >}})|Hard||||54.4%| +|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0785.Is-Graph-Bipartite.md" >}})|Medium||||48.2%| +|0802|Find Eventual Safe States|[Go]({{< relref "/ChapterFour/0802.Find-Eventual-Safe-States.md" >}})|Medium||||49.7%| +|0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||45.5%| +|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0839.Similar-String-Groups.md" >}})|Hard||||40.0%| +|0841|Keys and Rooms|[Go]({{< relref "/ChapterFour/0841.Keys-and-Rooms.md" >}})|Medium||||65.2%| +|0851|Loud and Rich|[Go]({{< relref "/ChapterFour/0851.Loud-and-Rich.md" >}})|Medium||||52.4%| +|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||57.5%| +|0872|Leaf-Similar Trees|[Go]({{< relref "/ChapterFour/0872.Leaf-Similar-Trees.md" >}})|Easy||||64.5%| +|0897|Increasing Order Search Tree|[Go]({{< relref "/ChapterFour/0897.Increasing-Order-Search-Tree.md" >}})|Easy||||74.3%| +|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0924.Minimize-Malware-Spread.md" >}})|Hard||||41.8%| +|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0928.Minimize-Malware-Spread-II.md" >}})|Hard||||41.2%| +|0947|Most Stones Removed with Same Row or Column|[Go]({{< relref "/ChapterFour/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}})|Medium||||55.4%| +|0959|Regions Cut By Slashes|[Go]({{< relref "/ChapterFour/0959.Regions-Cut-By-Slashes.md" >}})|Medium||||66.8%| +|0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0968.Binary-Tree-Cameras.md" >}})|Hard||||38.5%| +|0979|Distribute Coins in Binary Tree|[Go]({{< relref "/ChapterFour/0979.Distribute-Coins-in-Binary-Tree.md" >}})|Medium||||69.5%| +|0980|Unique Paths III|[Go]({{< relref "/ChapterFour/0980.Unique-Paths-III.md" >}})|Hard| O(n log n)| O(n)||77.1%| +|1020|Number of Enclaves|[Go]({{< relref "/ChapterFour/1020.Number-of-Enclaves.md" >}})|Medium||||58.7%| +|1026|Maximum Difference Between Node and Ancestor|[Go]({{< relref "/ChapterFour/1026.Maximum-Difference-Between-Node-and-Ancestor.md" >}})|Medium||||69.1%| +|1028|Recover a Tree From Preorder Traversal|[Go]({{< relref "/ChapterFour/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}})|Hard||||70.7%| +|1110|Delete Nodes And Return Forest|[Go]({{< relref "/ChapterFour/1110.Delete-Nodes-And-Return-Forest.md" >}})|Medium||||67.5%| +|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||67.8%| +|1145|Binary Tree Coloring Game|[Go]({{< relref "/ChapterFour/1145.Binary-Tree-Coloring-Game.md" >}})|Medium||||51.4%| +|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1254.Number-of-Closed-Islands.md" >}})|Medium||||61.5%| +|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1302.Deepest-Leaves-Sum.md" >}})|Medium||||84.1%| +|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1306.Jump-Game-III.md" >}})|Medium||||62.6%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Dynamic_Programming.md b/website/content/ChapterTwo/Dynamic_Programming.md index 2baddaa9..ccfc9c9e 100644 --- a/website/content/ChapterTwo/Dynamic_Programming.md +++ b/website/content/ChapterTwo/Dynamic_Programming.md @@ -5,32 +5,57 @@ type: docs # Dynamic Programming -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|53. Maximum Subarray| [Go]({{< relref "/ChapterFour/0053.Maximum-Subarray.md" >}})| Easy | O(n)| O(n)|| -|62. Unique Paths | [Go]({{< relref "/ChapterFour/0062.Unique-Paths.md" >}})| Medium | O(n^2)| O(n^2)|| -|63. Unique Paths II | [Go]({{< relref "/ChapterFour/0063.Unique-Paths-II.md" >}})| Medium | O(n^2)| O(n^2)|| -|64. Minimum Path Sum | [Go]({{< relref "/ChapterFour/0064.Minimum-Path-Sum.md" >}})| Medium | O(n^2)| O(n^2)|| -|70. Climbing Stairs | [Go]({{< relref "/ChapterFour/0070.Climbing-Stairs.md" >}})| Easy | O(n)| O(n)|| -|91. Decode Ways | [Go]({{< relref "/ChapterFour/0091.Decode-Ways.md" >}})| Medium | O(n)| O(n)|| -|96. Unique Binary Search Trees | [Go]({{< relref "/ChapterFour/0096.Unique-Binary-Search-Trees.md" >}})| Medium | O(n)| O(n)|| -|120. Triangle | [Go]({{< relref "/ChapterFour/0120.Triangle.md" >}})| Medium | O(n^2)| O(n)|| -|121. Best Time to Buy and Sell Stock | [Go]({{< relref "/ChapterFour/0121.Best-Time-to-Buy-and-Sell-Stock.md" >}})| Easy | O(n)| O(1)|| -|152. Maximum Product Subarray | [Go]({{< relref "/ChapterFour/0152.Maximum-Product-Subarray.md" >}})| Medium | O(n)| O(1)|| -|198. House Robber | [Go]({{< relref "/ChapterFour/0198.House-Robber.md" >}})| Easy | O(n)| O(n)|| -|213. House Robber II | [Go]({{< relref "/ChapterFour/0213.House-Robber-II.md" >}})| Medium | O(n)| O(n)|| -|300. Longest Increasing Subsequence | [Go]({{< relref "/ChapterFour/0300.Longest-Increasing-Subsequence.md" >}})| Medium | O(n log n)| O(n)|| -|309. Best Time to Buy and Sell Stock with Cooldown | [Go]({{< relref "/ChapterFour/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.md" >}})| Medium | O(n)| O(n)|| -|322. Coin Change | [Go]({{< relref "/ChapterFour/0322.Coin-Change.md" >}})| Medium | O(n)| O(n)|| -|338. Counting Bits | [Go]({{< relref "/ChapterFour/0338.Counting-Bits.md" >}})| Medium | O(n)| O(n)|| -|343. Integer Break | [Go]({{< relref "/ChapterFour/0343.Integer-Break.md" >}})| Medium | O(n^2)| O(n)|| -|357. Count Numbers with Unique Digits | [Go]({{< relref "/ChapterFour/0357.Count-Numbers-with-Unique-Digits.md" >}})| Medium | O(1)| O(1)|| -|392. Is Subsequence | [Go]({{< relref "/ChapterFour/0392.Is-Subsequence.md" >}})| Medium | O(n)| O(1)|| -|416. Partition Equal Subset Sum | [Go]({{< relref "/ChapterFour/0416.Partition-Equal-Subset-Sum.md" >}})| Medium | O(n^2)| O(n)|| -|714. Best Time to Buy and Sell Stock with Transaction Fee | [Go]({{< relref "/ChapterFour/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})| Medium | O(n)| O(1)|| -|746. Min Cost Climbing Stairs | [Go]({{< relref "/ChapterFour/0746.Min-Cost-Climbing-Stairs.md" >}})| Easy | O(n)| O(1)|| -|838. Push Dominoes | [Go]({{< relref "/ChapterFour/0838.Push-Dominoes.md" >}})| Medium | O(n)| O(n)|| -|1025. Divisor Game | [Go]({{< relref "/ChapterFour/1025.Divisor-Game.md" >}})| Easy | O(1)| O(1)|| -|891. Sum of Subsequence Widths | [Go]({{< relref "/ChapterFour/0891.Sum-of-Subsequence-Widths.md" >}})| Hard | O(n log n)| O(1)|| -|942. DI String Match | [Go]({{< relref "/ChapterFour/0942.DI-String-Match.md" >}})| Easy | O(n)| O(1)|| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0042.Trapping-Rain-Water.md" >}})|Hard||||50.7%| +|0053|Maximum Subarray|[Go]({{< relref "/ChapterFour/0053.Maximum-Subarray.md" >}})|Easy| O(n)| O(n)||47.5%| +|0062|Unique Paths|[Go]({{< relref "/ChapterFour/0062.Unique-Paths.md" >}})|Medium| O(n^2)| O(n^2)||55.6%| +|0063|Unique Paths II|[Go]({{< relref "/ChapterFour/0063.Unique-Paths-II.md" >}})|Medium| O(n^2)| O(n^2)||35.1%| +|0064|Minimum Path Sum|[Go]({{< relref "/ChapterFour/0064.Minimum-Path-Sum.md" >}})|Medium| O(n^2)| O(n^2)||55.9%| +|0070|Climbing Stairs|[Go]({{< relref "/ChapterFour/0070.Climbing-Stairs.md" >}})|Easy| O(n)| O(n)||48.5%| +|0091|Decode Ways|[Go]({{< relref "/ChapterFour/0091.Decode-Ways.md" >}})|Medium| O(n)| O(n)||26.2%| +|0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||42.1%| +|0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0096.Unique-Binary-Search-Trees.md" >}})|Medium| O(n)| O(n)||54.1%| +|0120|Triangle|[Go]({{< relref "/ChapterFour/0120.Triangle.md" >}})|Medium| O(n^2)| O(n)||45.5%| +|0121|Best Time to Buy and Sell Stock|[Go]({{< relref "/ChapterFour/0121.Best-Time-to-Buy-and-Sell-Stock.md" >}})|Easy| O(n)| O(1)||51.2%| +|0131|Palindrome Partitioning|[Go]({{< relref "/ChapterFour/0131.Palindrome-Partitioning.md" >}})|Medium||||51.3%| +|0152|Maximum Product Subarray|[Go]({{< relref "/ChapterFour/0152.Maximum-Product-Subarray.md" >}})|Medium| O(n)| O(1)||32.6%| +|0174|Dungeon Game|[Go]({{< relref "/ChapterFour/0174.Dungeon-Game.md" >}})|Hard||||33.1%| +|0198|House Robber|[Go]({{< relref "/ChapterFour/0198.House-Robber.md" >}})|Medium| O(n)| O(n)||42.7%| +|0213|House Robber II|[Go]({{< relref "/ChapterFour/0213.House-Robber-II.md" >}})|Medium| O(n)| O(n)||37.4%| +|0300|Longest Increasing Subsequence|[Go]({{< relref "/ChapterFour/0300.Longest-Increasing-Subsequence.md" >}})|Medium| O(n log n)| O(n)||43.6%| +|0303|Range Sum Query - Immutable|[Go]({{< relref "/ChapterFour/0303.Range-Sum-Query---Immutable.md" >}})|Easy||||47.0%| +|0309|Best Time to Buy and Sell Stock with Cooldown|[Go]({{< relref "/ChapterFour/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown.md" >}})|Medium| O(n)| O(n)||48.0%| +|0322|Coin Change|[Go]({{< relref "/ChapterFour/0322.Coin-Change.md" >}})|Medium| O(n)| O(n)||36.9%| +|0337|House Robber III|[Go]({{< relref "/ChapterFour/0337.House-Robber-III.md" >}})|Medium||||51.7%| +|0338|Counting Bits|[Go]({{< relref "/ChapterFour/0338.Counting-Bits.md" >}})|Medium| O(n)| O(n)||70.2%| +|0343|Integer Break|[Go]({{< relref "/ChapterFour/0343.Integer-Break.md" >}})|Medium| O(n^2)| O(n)||51.0%| +|0354|Russian Doll Envelopes|[Go]({{< relref "/ChapterFour/0354.Russian-Doll-Envelopes.md" >}})|Hard||||36.1%| +|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||48.7%| +|0392|Is Subsequence|[Go]({{< relref "/ChapterFour/0392.Is-Subsequence.md" >}})|Easy| O(n)| O(1)||49.5%| +|0410|Split Array Largest Sum|[Go]({{< relref "/ChapterFour/0410.Split-Array-Largest-Sum.md" >}})|Hard||||46.1%| +|0416|Partition Equal Subset Sum|[Go]({{< relref "/ChapterFour/0416.Partition-Equal-Subset-Sum.md" >}})|Medium| O(n^2)| O(n)||44.7%| +|0474|Ones and Zeroes|[Go]({{< relref "/ChapterFour/0474.Ones-and-Zeroes.md" >}})|Medium||||43.4%| +|0494|Target Sum|[Go]({{< relref "/ChapterFour/0494.Target-Sum.md" >}})|Medium||||45.9%| +|0638|Shopping Offers|[Go]({{< relref "/ChapterFour/0638.Shopping-Offers.md" >}})|Medium||||52.5%| +|0714|Best Time to Buy and Sell Stock with Transaction Fee|[Go]({{< relref "/ChapterFour/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}})|Medium| O(n)| O(1)||55.8%| +|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||50.1%| +|0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||50.9%| +|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||49.7%| +|0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0887.Super-Egg-Drop.md" >}})|Hard||||27.0%| +|0898|Bitwise ORs of Subarrays|[Go]({{< relref "/ChapterFour/0898.Bitwise-ORs-of-Subarrays.md" >}})|Medium||||34.0%| +|0920|Number of Music Playlists|[Go]({{< relref "/ChapterFour/0920.Number-of-Music-Playlists.md" >}})|Hard||||47.6%| +|0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0968.Binary-Tree-Cameras.md" >}})|Hard||||38.5%| +|0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0978.Longest-Turbulent-Subarray.md" >}})|Medium||||46.6%| +|1025|Divisor Game|[Go]({{< relref "/ChapterFour/1025.Divisor-Game.md" >}})|Easy| O(1)| O(1)||66.1%| +|1049|Last Stone Weight II|[Go]({{< relref "/ChapterFour/1049.Last-Stone-Weight-II.md" >}})|Medium||||45.0%| +|1074|Number of Submatrices That Sum to Target|[Go]({{< relref "/ChapterFour/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})|Hard||||61.4%| +|1105|Filling Bookcase Shelves|[Go]({{< relref "/ChapterFour/1105.Filling-Bookcase-Shelves.md" >}})|Medium||||57.7%| +|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||46.9%| +|1654|Minimum Jumps to Reach Home|[Go]({{< relref "/ChapterFour/1654.Minimum-Jumps-to-Reach-Home.md" >}})|Medium||||26.4%| +|1655|Distribute Repeating Integers|[Go]({{< relref "/ChapterFour/1655.Distribute-Repeating-Integers.md" >}})|Hard||||40.7%| +|1659|Maximize Grid Happiness|[Go]({{< relref "/ChapterFour/1659.Maximize-Grid-Happiness.md" >}})|Hard||||35.2%| +|1664|Ways to Make a Fair Array|[Go]({{< relref "/ChapterFour/1664.Ways-to-Make-a-Fair-Array.md" >}})|Medium||||60.6%| +|1690|Stone Game VII|[Go]({{< relref "/ChapterFour/1690.Stone-Game-VII.md" >}})|Medium||||46.5%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Hash_Table.md b/website/content/ChapterTwo/Hash_Table.md index ae4d2386..6424f1b3 100644 --- a/website/content/ChapterTwo/Hash_Table.md +++ b/website/content/ChapterTwo/Hash_Table.md @@ -5,39 +5,74 @@ type: docs # Hash Table -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|1. Two Sum | [Go]({{< relref "/ChapterFour/0001.Two-Sum.md" >}})| Easy | O(n)| O(n)|| -|3. Longest Substring Without Repeating Characters | [Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})| Medium | O(n)| O(1)|❤️| -|18. 4Sum | [Go]({{< relref "/ChapterFour/0018.4Sum.md" >}})| Medium | O(n^3)| O(n^2)|❤️| -|30. Substring with Concatenation of All Words | [Go]({{< relref "/ChapterFour/0030.Substring-with-Concatenation-of-All-Words.md" >}})| Hard | O(n)| O(n)|❤️| -|36. Valid Sudoku | [Go]({{< relref "/ChapterFour/0036.Valid-Sudoku.md" >}})| Medium | O(n^2)| O(n^2)|| -|37. Sudoku Solver | [Go]({{< relref "/ChapterFour/0037.Sudoku-Solver.md" >}})| Hard | O(n^2)| O(n^2)|❤️| -|49. Group Anagrams | [Go]({{< relref "/ChapterFour/0049.Group-Anagrams.md" >}})| Medium | O(n log n)| O(n)|| -|76. Minimum Window Substring | [Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})| Hard | O(n)| O(n)|❤️| -|94. Binary Tree Inorder Traversal | [Go]({{< relref "/ChapterFour/0094.Binary-Tree-Inorder-Traversal.md" >}})| Medium | O(n)| O(1)|| -|138. Copy List with Random Pointer | [Go]()| Medium | O(n)| O(1)|| -|202. Happy Number | [Go]({{< relref "/ChapterFour/0202.Happy-Number.md" >}})| Easy | O(log n)| O(1)|| -|205. Isomorphic Strings | [Go]({{< relref "/ChapterFour/0205.Isomorphic-Strings.md" >}})| Easy | O(log n)| O(n)|| -|217. Contains Duplicate | [Go]({{< relref "/ChapterFour/0217.Contains-Duplicate.md" >}})| Easy | O(n)| O(n)|| -|219. Contains Duplicate II | [Go]({{< relref "/ChapterFour/0219.Contains-Duplicate-II.md" >}})| Easy | O(n)| O(n)|| -|242. Valid Anagram | [Go]({{< relref "/ChapterFour/0242.Valid-Anagram.md" >}})| Easy | O(n)| O(n) || -|274. H-Index | [Go]({{< relref "/ChapterFour/0274.H-Index.md" >}})| Medium | O(n)| O(n) || -|290. Word Pattern | [Go]({{< relref "/ChapterFour/0290.Word-Pattern.md" >}})| Easy | O(n)| O(n) || -|347. Top K Frequent Elements | [Go]({{< relref "/ChapterFour/0347.Top-K-Frequent-Elements.md" >}})| Medium | O(n)| O(n) || -|349. Intersection of Two Arrays | [Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})| Easy | O(n)| O(n) || -|350. Intersection of Two Arrays II | [Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})| Easy | O(n)| O(n) || -|438. Find All Anagrams in a String | [Go]({{< relref "/ChapterFour/0438.Find-All-Anagrams-in-a-String.md" >}})| Easy | O(n)| O(1) || -|447. Number of Boomerangs | [Go]({{< relref "/ChapterFour/0447.Number-of-Boomerangs.md" >}})| Easy | O(n)| O(1) || -|451. Sort Characters By Frequency | [Go]({{< relref "/ChapterFour/0451.Sort-Characters-By-Frequency.md" >}})| Medium | O(n log n)| O(1) || -|454. 4Sum II | [Go]({{< relref "/ChapterFour/0454.4Sum-II.md" >}})| Medium | O(n^2)| O(n) || -|648. Replace Words | [Go]({{< relref "/ChapterFour/0648.Replace-Words.md" >}})| Medium | O(n)| O(n) || -|676. Implement Magic Dictionary | [Go]({{< relref "/ChapterFour/0676.Implement-Magic-Dictionary.md" >}})| Medium | O(n)| O(n) || -|720. Longest Word in Dictionary | [Go]({{< relref "/ChapterFour/0720.Longest-Word-in-Dictionary.md" >}})| Easy | O(n)| O(n) || -|726. Number of Atoms | [Go]({{< relref "/ChapterFour/0726.Number-of-Atoms.md" >}})| Hard | O(n)| O(n) |❤️| -|739. Daily Temperatures | [Go]({{< relref "/ChapterFour/0739.Daily-Temperatures.md" >}})| Medium | O(n)| O(n) || -|710. Random Pick with Blacklist | [Go]({{< relref "/ChapterFour/0710.Random-Pick-with-Blacklist.md" >}})| Hard | O(n)| O(n) || -|895. Maximum Frequency Stack | [Go]({{< relref "/ChapterFour/0895.Maximum-Frequency-Stack.md" >}})| Hard | O(n)| O(n) || -|930. Binary Subarrays With Sum | [Go]({{< relref "/ChapterFour/0930.Binary-Subarrays-With-Sum.md" >}})| Medium | O(n)| O(n) |❤️| -|992. Subarrays with K Different Integers | [Go]({{< relref "/ChapterFour/0992.Subarrays-with-K-Different-Integers.md" >}})| Hard | O(n)| O(n) |❤️| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0001|Two Sum|[Go]({{< relref "/ChapterFour/0001.Two-Sum.md" >}})|Easy| O(n)| O(n)||46.2%| +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.3%| +|0018|4Sum|[Go]({{< relref "/ChapterFour/0018.4Sum.md" >}})|Medium| O(n^3)| O(n^2)|❤️|34.6%| +|0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard| O(n)| O(n)|❤️|26.0%| +|0036|Valid Sudoku|[Go]({{< relref "/ChapterFour/0036.Valid-Sudoku.md" >}})|Medium| O(n^2)| O(n^2)||50.2%| +|0037|Sudoku Solver|[Go]({{< relref "/ChapterFour/0037.Sudoku-Solver.md" >}})|Hard| O(n^2)| O(n^2)|❤️|45.9%| +|0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0049.Group-Anagrams.md" >}})|Medium| O(n log n)| O(n)||58.8%| +|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|35.7%| +|0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0094.Binary-Tree-Inorder-Traversal.md" >}})|Medium| O(n)| O(1)||65.4%| +|0136|Single Number|[Go]({{< relref "/ChapterFour/0136.Single-Number.md" >}})|Easy||||66.4%| +|0187|Repeated DNA Sequences|[Go]({{< relref "/ChapterFour/0187.Repeated-DNA-Sequences.md" >}})|Medium||||41.2%| +|0202|Happy Number|[Go]({{< relref "/ChapterFour/0202.Happy-Number.md" >}})|Easy| O(log n)| O(1)||51.1%| +|0204|Count Primes|[Go]({{< relref "/ChapterFour/0204.Count-Primes.md" >}})|Easy||||32.1%| +|0205|Isomorphic Strings|[Go]({{< relref "/ChapterFour/0205.Isomorphic-Strings.md" >}})|Easy| O(log n)| O(n)||40.3%| +|0217|Contains Duplicate|[Go]({{< relref "/ChapterFour/0217.Contains-Duplicate.md" >}})|Easy| O(n)| O(n)||56.5%| +|0219|Contains Duplicate II|[Go]({{< relref "/ChapterFour/0219.Contains-Duplicate-II.md" >}})|Easy| O(n)| O(n)||38.5%| +|0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0242.Valid-Anagram.md" >}})|Easy| O(n)| O(n) ||57.9%| +|0274|H-Index|[Go]({{< relref "/ChapterFour/0274.H-Index.md" >}})|Medium| O(n)| O(n) ||36.3%| +|0290|Word Pattern|[Go]({{< relref "/ChapterFour/0290.Word-Pattern.md" >}})|Easy| O(n)| O(n) ||38.2%| +|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0347.Top-K-Frequent-Elements.md" >}})|Medium| O(n)| O(n) ||62.2%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.4%| +|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||51.9%| +|0387|First Unique Character in a String|[Go]({{< relref "/ChapterFour/0387.First-Unique-Character-in-a-String.md" >}})|Easy||||53.7%| +|0389|Find the Difference|[Go]({{< relref "/ChapterFour/0389.Find-the-Difference.md" >}})|Easy||||57.7%| +|0409|Longest Palindrome|[Go]({{< relref "/ChapterFour/0409.Longest-Palindrome.md" >}})|Easy||||52.1%| +|0438|Find All Anagrams in a String|[Go]({{< relref "/ChapterFour/0438.Find-All-Anagrams-in-a-String.md" >}})|Medium| O(n)| O(1) ||44.7%| +|0447|Number of Boomerangs|[Go]({{< relref "/ChapterFour/0447.Number-of-Boomerangs.md" >}})|Medium| O(n)| O(1) ||52.3%| +|0451|Sort Characters By Frequency|[Go]({{< relref "/ChapterFour/0451.Sort-Characters-By-Frequency.md" >}})|Medium| O(n log n)| O(1) ||64.1%| +|0454|4Sum II|[Go]({{< relref "/ChapterFour/0454.4Sum-II.md" >}})|Medium| O(n^2)| O(n) ||54.5%| +|0463|Island Perimeter|[Go]({{< relref "/ChapterFour/0463.Island-Perimeter.md" >}})|Easy||||66.5%| +|0500|Keyboard Row|[Go]({{< relref "/ChapterFour/0500.Keyboard-Row.md" >}})|Easy||||65.5%| +|0508|Most Frequent Subtree Sum|[Go]({{< relref "/ChapterFour/0508.Most-Frequent-Subtree-Sum.md" >}})|Medium||||58.9%| +|0575|Distribute Candies|[Go]({{< relref "/ChapterFour/0575.Distribute-Candies.md" >}})|Easy||||61.9%| +|0594|Longest Harmonious Subsequence|[Go]({{< relref "/ChapterFour/0594.Longest-Harmonious-Subsequence.md" >}})|Easy||||47.7%| +|0599|Minimum Index Sum of Two Lists|[Go]({{< relref "/ChapterFour/0599.Minimum-Index-Sum-of-Two-Lists.md" >}})|Easy||||51.5%| +|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||53.9%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0645.Set-Mismatch.md" >}})|Easy||||42.5%| +|0648|Replace Words|[Go]({{< relref "/ChapterFour/0648.Replace-Words.md" >}})|Medium| O(n)| O(n) ||58.2%| +|0676|Implement Magic Dictionary|[Go]({{< relref "/ChapterFour/0676.Implement-Magic-Dictionary.md" >}})|Medium| O(n)| O(n) ||55.1%| +|0705|Design HashSet|[Go]({{< relref "/ChapterFour/0705.Design-HashSet.md" >}})|Easy||||64.6%| +|0706|Design HashMap|[Go]({{< relref "/ChapterFour/0706.Design-HashMap.md" >}})|Easy||||62.5%| +|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||32.7%| +|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||50.1%| +|0720|Longest Word in Dictionary|[Go]({{< relref "/ChapterFour/0720.Longest-Word-in-Dictionary.md" >}})|Easy| O(n)| O(n) ||49.0%| +|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0726.Number-of-Atoms.md" >}})|Hard| O(n)| O(n) |❤️|51.0%| +|0739|Daily Temperatures|[Go]({{< relref "/ChapterFour/0739.Daily-Temperatures.md" >}})|Medium| O(n)| O(n) ||64.3%| +|0748|Shortest Completing Word|[Go]({{< relref "/ChapterFour/0748.Shortest-Completing-Word.md" >}})|Easy||||57.4%| +|0771|Jewels and Stones|[Go]({{< relref "/ChapterFour/0771.Jewels-and-Stones.md" >}})|Easy||||86.8%| +|0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0781.Rabbits-in-Forest.md" >}})|Medium||||55.4%| +|0811|Subdomain Visit Count|[Go]({{< relref "/ChapterFour/0811.Subdomain-Visit-Count.md" >}})|Easy||||71.2%| +|0884|Uncommon Words from Two Sentences|[Go]({{< relref "/ChapterFour/0884.Uncommon-Words-from-Two-Sentences.md" >}})|Easy||||63.9%| +|0895|Maximum Frequency Stack|[Go]({{< relref "/ChapterFour/0895.Maximum-Frequency-Stack.md" >}})|Hard| O(n)| O(n) ||62.1%| +|0930|Binary Subarrays With Sum|[Go]({{< relref "/ChapterFour/0930.Binary-Subarrays-With-Sum.md" >}})|Medium| O(n)| O(n) |❤️|44.3%| +|0953|Verifying an Alien Dictionary|[Go]({{< relref "/ChapterFour/0953.Verifying-an-Alien-Dictionary.md" >}})|Easy||||52.5%| +|0961|N-Repeated Element in Size 2N Array|[Go]({{< relref "/ChapterFour/0961.N-Repeated-Element-in-Size-2N-Array.md" >}})|Easy||||74.4%| +|0970|Powerful Integers|[Go]({{< relref "/ChapterFour/0970.Powerful-Integers.md" >}})|Easy||||39.9%| +|0981|Time Based Key-Value Store|[Go]({{< relref "/ChapterFour/0981.Time-Based-Key-Value-Store.md" >}})|Medium||||53.9%| +|0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n) |❤️|50.4%| +|1002|Find Common Characters|[Go]({{< relref "/ChapterFour/1002.Find-Common-Characters.md" >}})|Easy||||68.1%| +|1078|Occurrences After Bigram|[Go]({{< relref "/ChapterFour/1078.Occurrences-After-Bigram.md" >}})|Easy||||64.9%| +|1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.5%| +|1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||61.8%| +|1207|Unique Number of Occurrences|[Go]({{< relref "/ChapterFour/1207.Unique-Number-of-Occurrences.md" >}})|Easy||||71.6%| +|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.9%| +|1539|Kth Missing Positive Number|[Go]({{< relref "/ChapterFour/1539.Kth-Missing-Positive-Number.md" >}})|Easy||||55.3%| +|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||62.3%| +|1679|Max Number of K-Sum Pairs|[Go]({{< relref "/ChapterFour/1679.Max-Number-of-K-Sum-Pairs.md" >}})|Medium||||52.0%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Linked_List.md b/website/content/ChapterTwo/Linked_List.md index d786f466..ef03c6e9 100644 --- a/website/content/ChapterTwo/Linked_List.md +++ b/website/content/ChapterTwo/Linked_List.md @@ -19,35 +19,40 @@ type: docs -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|2. Add Two Numbers | [Go]({{< relref "/ChapterFour/0002.Add-Two-Numbers.md" >}})| Medium | O(n)| O(1)|| -|19. Remove Nth Node From End of List | [Go]({{< relref "/ChapterFour/0019.Remove-Nth-Node-From-End-of-List.md" >}})| Medium | O(n)| O(1)|| -|21. Merge Two Sorted Lists | [Go]({{< relref "/ChapterFour/0021.Merge-Two-Sorted-Lists.md" >}})| Easy | O(log n)| O(1)|| -|23. Merge k Sorted Lists| [Go]({{< relref "/ChapterFour/0023.Merge-k-Sorted-Lists.md" >}})| Hard | O(log n)| O(1)|❤️| -|24. Swap Nodes in Pairs | [Go]({{< relref "/ChapterFour/0024.Swap-Nodes-in-Pairs.md" >}})| Medium | O(n)| O(1)|| -|25. Reverse Nodes in k-Group | [Go]({{< relref "/ChapterFour/0025.Reverse-Nodes-in-k-Group.md" >}})| Hard | O(log n)| O(1)|❤️| -|61. Rotate List | [Go]({{< relref "/ChapterFour/0061.Rotate-List.md" >}})| Medium | O(n)| O(1)|| -|82. Remove Duplicates from Sorted List II | [Go]({{< relref "/ChapterFour/0082.Remove-Duplicates-from-Sorted-List-II.md" >}})| Medium | O(n)| O(1)|| -|83. Remove Duplicates from Sorted List | [Go]({{< relref "/ChapterFour/0083.Remove-Duplicates-from-Sorted-List.md" >}})| Easy | O(n)| O(1)|| -|86. Partition List | [Go]({{< relref "/ChapterFour/0086.Partition-List.md" >}})| Medium | O(n)| O(1)|❤️| -|92. Reverse Linked List II | [Go]({{< relref "/ChapterFour/0092.Reverse-Linked-List-II.md" >}})| Medium | O(n)| O(1)|❤️| -|109. Convert Sorted List to Binary Search Tree | [Go]({{< relref "/ChapterFour/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})| Medium | O(log n)| O(n)|| -|141. Linked List Cycle | [Go]({{< relref "/ChapterFour/0141.Linked-List-Cycle.md" >}})| Easy | O(n)| O(1)|❤️| -|142. Linked List Cycle II | [Go]({{< relref "/ChapterFour/0142.Linked-List-Cycle-II.md" >}})| Medium | O(n)| O(1)|❤️| -|143. Reorder List | [Go]({{< relref "/ChapterFour/0143.Reorder-List.md" >}})| Medium | O(n)| O(1)|❤️| -|147. Insertion Sort List | [Go]({{< relref "/ChapterFour/0147.Insertion-Sort-List.md" >}})| Medium | O(n)| O(1)|❤️| -|148. Sort List | [Go]({{< relref "/ChapterFour/0148.Sort-List.md" >}})| Medium | O(n log n)| O(n)|❤️| -|160. Intersection of Two Linked Lists | [Go]({{< relref "/ChapterFour/0160.Intersection-of-Two-Linked-Lists.md" >}})| Easy | O(n)| O(1)|❤️| -|203. Remove Linked List Elements | [Go]({{< relref "/ChapterFour/0203.Remove-Linked-List-Elements.md" >}})| Easy | O(n)| O(1)|| -|206. Reverse Linked List | [Go]({{< relref "/ChapterFour/0206.Reverse-Linked-List.md" >}})| Easy | O(n)| O(1)|| -|234. Palindrome Linked List | [Go]({{< relref "/ChapterFour/0234.Palindrome-Linked-List.md" >}})| Easy | O(n)| O(1)|| -|237. Delete Node in a Linked List | [Go]({{< relref "/ChapterFour/0237.Delete-Node-in-a-Linked-List.md" >}})| Easy | O(n)| O(1)|| -|328. Odd Even Linked List | [Go]({{< relref "/ChapterFour/0328.Odd-Even-Linked-List.md" >}})| Medium | O(n)| O(1)|| -|445. Add Two Numbers II | [Go]({{< relref "/ChapterFour/0445.Add-Two-Numbers-II.md" >}})| Medium | O(n)| O(n)|| -|725. Split Linked List in Parts | [Go]({{< relref "/ChapterFour/0725.Split-Linked-List-in-Parts.md" >}})| Medium | O(n)| O(1)|| -|817. Linked List Components | [Go]({{< relref "/ChapterFour/0817.Linked-List-Components.md" >}})| Medium | O(n)| O(1)|| -|707. Design Linked List | [Go]({{< relref "/ChapterFour/0707.Design-Linked-List.md" >}})| Easy | O(n)| O(1)|| -|876. Middle of the Linked List | [Go]({{< relref "/ChapterFour/0876.Middle-of-the-Linked-List.md" >}})| Easy | O(n)| O(1)|❤️| -|1019. Next Greater Node In Linked List | [Go]({{< relref "/ChapterFour/1019.Next-Greater-Node-In-Linked-List.md" >}})| Medium | O(n)| O(1)|| -|---------------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||35.2%| +|0019|Remove Nth Node From End of List|[Go]({{< relref "/ChapterFour/0019.Remove-Nth-Node-From-End-of-List.md" >}})|Medium| O(n)| O(1)||35.6%| +|0021|Merge Two Sorted Lists|[Go]({{< relref "/ChapterFour/0021.Merge-Two-Sorted-Lists.md" >}})|Easy| O(log n)| O(1)||55.6%| +|0023|Merge k Sorted Lists|[Go]({{< relref "/ChapterFour/0023.Merge-k-Sorted-Lists.md" >}})|Hard| O(log n)| O(1)|❤️|42.0%| +|0024|Swap Nodes in Pairs|[Go]({{< relref "/ChapterFour/0024.Swap-Nodes-in-Pairs.md" >}})|Medium| O(n)| O(1)||52.6%| +|0025|Reverse Nodes in k-Group|[Go]({{< relref "/ChapterFour/0025.Reverse-Nodes-in-k-Group.md" >}})|Hard| O(log n)| O(1)|❤️|44.2%| +|0061|Rotate List|[Go]({{< relref "/ChapterFour/0061.Rotate-List.md" >}})|Medium| O(n)| O(1)||31.6%| +|0082|Remove Duplicates from Sorted List II|[Go]({{< relref "/ChapterFour/0082.Remove-Duplicates-from-Sorted-List-II.md" >}})|Medium| O(n)| O(1)||39.0%| +|0083|Remove Duplicates from Sorted List|[Go]({{< relref "/ChapterFour/0083.Remove-Duplicates-from-Sorted-List.md" >}})|Easy| O(n)| O(1)||46.3%| +|0086|Partition List|[Go]({{< relref "/ChapterFour/0086.Partition-List.md" >}})|Medium| O(n)| O(1)|❤️|43.0%| +|0092|Reverse Linked List II|[Go]({{< relref "/ChapterFour/0092.Reverse-Linked-List-II.md" >}})|Medium| O(n)| O(1)|❤️|40.2%| +|0109|Convert Sorted List to Binary Search Tree|[Go]({{< relref "/ChapterFour/0109.Convert-Sorted-List-to-Binary-Search-Tree.md" >}})|Medium| O(log n)| O(n)||49.8%| +|0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0141.Linked-List-Cycle.md" >}})|Easy| O(n)| O(1)|❤️|42.2%| +|0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0142.Linked-List-Cycle-II.md" >}})|Medium| O(n)| O(1)|❤️|39.3%| +|0143|Reorder List|[Go]({{< relref "/ChapterFour/0143.Reorder-List.md" >}})|Medium| O(n)| O(1)|❤️|40.2%| +|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0147.Insertion-Sort-List.md" >}})|Medium| O(n)| O(1)|❤️|44.1%| +|0148|Sort List|[Go]({{< relref "/ChapterFour/0148.Sort-List.md" >}})|Medium| O(n log n)| O(n)|❤️|45.8%| +|0160|Intersection of Two Linked Lists|[Go]({{< relref "/ChapterFour/0160.Intersection-of-Two-Linked-Lists.md" >}})|Easy| O(n)| O(1)|❤️|42.6%| +|0203|Remove Linked List Elements|[Go]({{< relref "/ChapterFour/0203.Remove-Linked-List-Elements.md" >}})|Easy| O(n)| O(1)||39.0%| +|0206|Reverse Linked List|[Go]({{< relref "/ChapterFour/0206.Reverse-Linked-List.md" >}})|Easy| O(n)| O(1)||64.8%| +|0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0234.Palindrome-Linked-List.md" >}})|Easy| O(n)| O(1)||40.2%| +|0237|Delete Node in a Linked List|[Go]({{< relref "/ChapterFour/0237.Delete-Node-in-a-Linked-List.md" >}})|Easy| O(n)| O(1)||66.3%| +|0328|Odd Even Linked List|[Go]({{< relref "/ChapterFour/0328.Odd-Even-Linked-List.md" >}})|Medium| O(n)| O(1)||56.9%| +|0445|Add Two Numbers II|[Go]({{< relref "/ChapterFour/0445.Add-Two-Numbers-II.md" >}})|Medium| O(n)| O(n)||56.0%| +|0707|Design Linked List|[Go]({{< relref "/ChapterFour/0707.Design-Linked-List.md" >}})|Medium| O(n)| O(1)||25.7%| +|0725|Split Linked List in Parts|[Go]({{< relref "/ChapterFour/0725.Split-Linked-List-in-Parts.md" >}})|Medium| O(n)| O(1)||52.8%| +|0817|Linked List Components|[Go]({{< relref "/ChapterFour/0817.Linked-List-Components.md" >}})|Medium| O(n)| O(1)||57.6%| +|0876|Middle of the Linked List|[Go]({{< relref "/ChapterFour/0876.Middle-of-the-Linked-List.md" >}})|Easy| O(n)| O(1)|❤️|68.9%| +|1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium| O(n)| O(1)||58.2%| +|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||41.4%| +|1290|Convert Binary Number in a Linked List to Integer|[Go]({{< relref "/ChapterFour/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})|Easy||||81.6%| +|1669|Merge In Between Linked Lists|[Go]({{< relref "/ChapterFour/1669.Merge-In-Between-Linked-Lists.md" >}})|Medium||||78.2%| +|1670|Design Front Middle Back Queue|[Go]({{< relref "/ChapterFour/1670.Design-Front-Middle-Back-Queue.md" >}})|Medium||||54.6%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Math.md b/website/content/ChapterTwo/Math.md index b20da7a3..afecf1c9 100644 --- a/website/content/ChapterTwo/Math.md +++ b/website/content/ChapterTwo/Math.md @@ -5,24 +5,77 @@ type: docs # Math -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|2. Add Two Numbers | [Go]({{< relref "/ChapterFour/0002.Add-Two-Numbers.md" >}})| Medium | O(n)| O(1)|| -|50. Pow(x, n) | [Go]({{< relref "/ChapterFour/0050.Powx-n.md" >}})| Medium | O(log n)| O(1)|| -|60. Permutation Sequence | [Go]({{< relref "/ChapterFour/0060.Permutation-Sequence.md" >}})| Medium | O(n log n)| O(1)|| -|69. Sqrt(x) | [Go]({{< relref "/ChapterFour/0069.Sqrtx.md" >}})| Easy | O(log n)| O(1)|| -|202. Happy Number | [Go]({{< relref "/ChapterFour/0202.Happy-Number.md" >}})| Easy | O(log n)| O(1)|| -|224. Basic Calculator | [Go]({{< relref "/ChapterFour/0224.Basic-Calculator.md" >}})| Hard | O(n)| O(n)|| -|231. Power of Two | [Go]({{< relref "/ChapterFour/0231.Power-of-Two.md" >}})| Easy | O(1)| O(1)|| -|263. Ugly Number | [Go]({{< relref "/ChapterFour/0263.Ugly-Number.md" >}})| Easy | O(log n)| O(1)|| -|326. Power of Three | [Go]({{< relref "/ChapterFour/0326.Power-of-Three.md" >}})| Easy | O(1)| O(1)|| -|343. Integer Break | [Go]({{< relref "/ChapterFour/0343.Integer-Break.md" >}})| Medium | O(n^2)| O(n)|| -|357. Count Numbers with Unique Digits | [Go]({{< relref "/ChapterFour/0357.Count-Numbers-with-Unique-Digits.md" >}})| Medium | O(1)| O(1)|| -|628. Maximum Product of Three Numbers | [Go]({{< relref "/ChapterFour/0628.Maximum-Product-of-Three-Numbers.md" >}})| Easy | O(n)| O(1)|| -|885. Spiral Matrix III | [Go]({{< relref "/ChapterFour/0885.Spiral-Matrix-III.md" >}})| Medium | O(n^2)| O(1)|| -|891. Sum of Subsequence Widths | [Go]({{< relref "/ChapterFour/0891.Sum-of-Subsequence-Widths.md" >}})| Hard | O(n log n)| O(1)|| -|942. DI String Match | [Go]({{< relref "/ChapterFour/0942.DI-String-Match.md" >}})| Easy | O(n)| O(1)|| -|976. Largest Perimeter Triangle | [Go]({{< relref "/ChapterFour/0976.Largest-Perimeter-Triangle.md" >}})| Easy | O(n log n)| O(log n) || -|996. Number of Squareful Arrays | [Go]({{< relref "/ChapterFour/0996.Number-of-Squareful-Arrays.md" >}})| Hard | O(n log n)| O(n) || -|1025. Divisor Game | [Go]({{< relref "/ChapterFour/1025.Divisor-Game.md" >}})| Easy | O(1)| O(1)|| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0002|Add Two Numbers|[Go]({{< relref "/ChapterFour/0002.Add-Two-Numbers.md" >}})|Medium| O(n)| O(1)||35.2%| +|0007|Reverse Integer|[Go]({{< relref "/ChapterFour/0007.Reverse-Integer.md" >}})|Easy||||25.8%| +|0009|Palindrome Number|[Go]({{< relref "/ChapterFour/0009.Palindrome-Number.md" >}})|Easy||||49.5%| +|0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0013.Roman-to-Integer.md" >}})|Easy||||56.4%| +|0029|Divide Two Integers|[Go]({{< relref "/ChapterFour/0029.Divide-Two-Integers.md" >}})|Medium||||16.6%| +|0050|Pow(x, n)|[Go]({{< relref "/ChapterFour/0050.Powx-n.md" >}})|Medium| O(log n)| O(1)||30.8%| +|0060|Permutation Sequence|[Go]({{< relref "/ChapterFour/0060.Permutation-Sequence.md" >}})|Hard| O(n log n)| O(1)||39.2%| +|0067|Add Binary|[Go]({{< relref "/ChapterFour/0067.Add-Binary.md" >}})|Easy||||46.6%| +|0069|Sqrt(x)|[Go]({{< relref "/ChapterFour/0069.Sqrtx.md" >}})|Easy| O(log n)| O(1)||34.8%| +|0168|Excel Sheet Column Title|[Go]({{< relref "/ChapterFour/0168.Excel-Sheet-Column-Title.md" >}})|Easy||||31.6%| +|0171|Excel Sheet Column Number|[Go]({{< relref "/ChapterFour/0171.Excel-Sheet-Column-Number.md" >}})|Easy||||56.7%| +|0172|Factorial Trailing Zeroes|[Go]({{< relref "/ChapterFour/0172.Factorial-Trailing-Zeroes.md" >}})|Easy||||38.4%| +|0202|Happy Number|[Go]({{< relref "/ChapterFour/0202.Happy-Number.md" >}})|Easy| O(log n)| O(1)||51.1%| +|0204|Count Primes|[Go]({{< relref "/ChapterFour/0204.Count-Primes.md" >}})|Easy||||32.1%| +|0223|Rectangle Area|[Go]({{< relref "/ChapterFour/0223.Rectangle-Area.md" >}})|Medium||||38.1%| +|0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0224.Basic-Calculator.md" >}})|Hard| O(n)| O(n)||38.0%| +|0231|Power of Two|[Go]({{< relref "/ChapterFour/0231.Power-of-Two.md" >}})|Easy| O(1)| O(1)||43.8%| +|0258|Add Digits|[Go]({{< relref "/ChapterFour/0258.Add-Digits.md" >}})|Easy||||58.3%| +|0263|Ugly Number|[Go]({{< relref "/ChapterFour/0263.Ugly-Number.md" >}})|Easy| O(log n)| O(1)||41.7%| +|0268|Missing Number|[Go]({{< relref "/ChapterFour/0268.Missing-Number.md" >}})|Easy||||53.4%| +|0326|Power of Three|[Go]({{< relref "/ChapterFour/0326.Power-of-Three.md" >}})|Easy| O(1)| O(1)||42.1%| +|0343|Integer Break|[Go]({{< relref "/ChapterFour/0343.Integer-Break.md" >}})|Medium| O(n^2)| O(n)||51.0%| +|0357|Count Numbers with Unique Digits|[Go]({{< relref "/ChapterFour/0357.Count-Numbers-with-Unique-Digits.md" >}})|Medium| O(1)| O(1)||48.7%| +|0367|Valid Perfect Square|[Go]({{< relref "/ChapterFour/0367.Valid-Perfect-Square.md" >}})|Easy||||42.0%| +|0372|Super Pow|[Go]({{< relref "/ChapterFour/0372.Super-Pow.md" >}})|Medium||||36.6%| +|0397|Integer Replacement|[Go]({{< relref "/ChapterFour/0397.Integer-Replacement.md" >}})|Medium||||33.4%| +|0441|Arranging Coins|[Go]({{< relref "/ChapterFour/0441.Arranging-Coins.md" >}})|Easy||||42.3%| +|0447|Number of Boomerangs|[Go]({{< relref "/ChapterFour/0447.Number-of-Boomerangs.md" >}})|Medium||||52.3%| +|0453|Minimum Moves to Equal Array Elements|[Go]({{< relref "/ChapterFour/0453.Minimum-Moves-to-Equal-Array-Elements.md" >}})|Easy||||50.7%| +|0483|Smallest Good Base|[Go]({{< relref "/ChapterFour/0483.Smallest-Good-Base.md" >}})|Hard||||36.2%| +|0507|Perfect Number|[Go]({{< relref "/ChapterFour/0507.Perfect-Number.md" >}})|Easy||||36.0%| +|0537|Complex Number Multiplication|[Go]({{< relref "/ChapterFour/0537.Complex-Number-Multiplication.md" >}})|Medium||||68.3%| +|0598|Range Addition II|[Go]({{< relref "/ChapterFour/0598.Range-Addition-II.md" >}})|Easy||||50.0%| +|0628|Maximum Product of Three Numbers|[Go]({{< relref "/ChapterFour/0628.Maximum-Product-of-Three-Numbers.md" >}})|Easy| O(n)| O(1)||47.0%| +|0633|Sum of Square Numbers|[Go]({{< relref "/ChapterFour/0633.Sum-of-Square-Numbers.md" >}})|Medium||||32.4%| +|0645|Set Mismatch|[Go]({{< relref "/ChapterFour/0645.Set-Mismatch.md" >}})|Easy||||42.5%| +|0753|Cracking the Safe|[Go]({{< relref "/ChapterFour/0753.Cracking-the-Safe.md" >}})|Hard||||52.0%| +|0781|Rabbits in Forest|[Go]({{< relref "/ChapterFour/0781.Rabbits-in-Forest.md" >}})|Medium||||55.4%| +|0812|Largest Triangle Area|[Go]({{< relref "/ChapterFour/0812.Largest-Triangle-Area.md" >}})|Easy||||58.8%| +|0836|Rectangle Overlap|[Go]({{< relref "/ChapterFour/0836.Rectangle-Overlap.md" >}})|Easy||||45.1%| +|0878|Nth Magical Number|[Go]({{< relref "/ChapterFour/0878.Nth-Magical-Number.md" >}})|Hard||||28.9%| +|0885|Spiral Matrix III|[Go]({{< relref "/ChapterFour/0885.Spiral-Matrix-III.md" >}})|Medium| O(n^2)| O(1)||70.5%| +|0887|Super Egg Drop|[Go]({{< relref "/ChapterFour/0887.Super-Egg-Drop.md" >}})|Hard||||27.0%| +|0891|Sum of Subsequence Widths|[Go]({{< relref "/ChapterFour/0891.Sum-of-Subsequence-Widths.md" >}})|Hard| O(n log n)| O(1)||32.8%| +|0892|Surface Area of 3D Shapes|[Go]({{< relref "/ChapterFour/0892.Surface-Area-of-3D-Shapes.md" >}})|Easy||||59.5%| +|0910|Smallest Range II|[Go]({{< relref "/ChapterFour/0910.Smallest-Range-II.md" >}})|Medium||||31.2%| +|0914|X of a Kind in a Deck of Cards|[Go]({{< relref "/ChapterFour/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}})|Easy||||34.4%| +|0927|Three Equal Parts|[Go]({{< relref "/ChapterFour/0927.Three-Equal-Parts.md" >}})|Hard||||34.5%| +|0942|DI String Match|[Go]({{< relref "/ChapterFour/0942.DI-String-Match.md" >}})|Easy| O(n)| O(1)||73.4%| +|0949|Largest Time for Given Digits|[Go]({{< relref "/ChapterFour/0949.Largest-Time-for-Given-Digits.md" >}})|Medium||||36.2%| +|0952|Largest Component Size by Common Factor|[Go]({{< relref "/ChapterFour/0952.Largest-Component-Size-by-Common-Factor.md" >}})|Hard||||36.1%| +|0970|Powerful Integers|[Go]({{< relref "/ChapterFour/0970.Powerful-Integers.md" >}})|Easy||||39.9%| +|0976|Largest Perimeter Triangle|[Go]({{< relref "/ChapterFour/0976.Largest-Perimeter-Triangle.md" >}})|Easy| O(n log n)| O(log n) ||58.5%| +|0996|Number of Squareful Arrays|[Go]({{< relref "/ChapterFour/0996.Number-of-Squareful-Arrays.md" >}})|Hard| O(n log n)| O(n) ||48.0%| +|1017|Convert to Base -2|[Go]({{< relref "/ChapterFour/1017.Convert-to-Base--2.md" >}})|Medium||||59.6%| +|1025|Divisor Game|[Go]({{< relref "/ChapterFour/1025.Divisor-Game.md" >}})|Easy| O(1)| O(1)||66.1%| +|1037|Valid Boomerang|[Go]({{< relref "/ChapterFour/1037.Valid-Boomerang.md" >}})|Easy||||37.9%| +|1073|Adding Two Negabinary Numbers|[Go]({{< relref "/ChapterFour/1073.Adding-Two-Negabinary-Numbers.md" >}})|Medium||||34.7%| +|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1093.Statistics-from-a-Large-Sample.md" >}})|Medium||||49.3%| +|1154|Day of the Year|[Go]({{< relref "/ChapterFour/1154.Day-of-the-Year.md" >}})|Easy||||49.3%| +|1175|Prime Arrangements|[Go]({{< relref "/ChapterFour/1175.Prime-Arrangements.md" >}})|Easy||||51.8%| +|1201|Ugly Number III|[Go]({{< relref "/ChapterFour/1201.Ugly-Number-III.md" >}})|Medium||||26.3%| +|1217|Minimum Cost to Move Chips to The Same Position|[Go]({{< relref "/ChapterFour/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position.md" >}})|Easy||||71.2%| +|1232|Check If It Is a Straight Line|[Go]({{< relref "/ChapterFour/1232.Check-If-It-Is-a-Straight-Line.md" >}})|Easy||||43.9%| +|1281|Subtract the Product and Sum of Digits of an Integer|[Go]({{< relref "/ChapterFour/1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer.md" >}})|Easy||||85.6%| +|1317|Convert Integer to the Sum of Two No-Zero Integers|[Go]({{< relref "/ChapterFour/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers.md" >}})|Easy||||56.8%| +|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.9%| +|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.9%| +|1680|Concatenation of Consecutive Binary Numbers|[Go]({{< relref "/ChapterFour/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})|Medium||||45.1%| +|1685|Sum of Absolute Differences in a Sorted Array|[Go]({{< relref "/ChapterFour/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array.md" >}})|Medium||||61.7%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Segment_Tree.md b/website/content/ChapterTwo/Segment_Tree.md index fb0c06b9..0f053551 100644 --- a/website/content/ChapterTwo/Segment_Tree.md +++ b/website/content/ChapterTwo/Segment_Tree.md @@ -33,16 +33,18 @@ type: docs [HDU 1542 Atlantis](http://acm.hdu.edu.cn/showproblem.php?pid=1542) update:区间增减 query:直接取根节点的值 [HDU 1828 Picture](http://acm.hdu.edu.cn/showproblem.php?pid=1828) update:区间增减 query:直接取根节点的值 -| Title | Solution | Difficulty | Time | Space | 收藏 | -| ----- | :--------: | :----------: | :----: | :-----: |:-----: | -|218. The Skyline Problem | [Go]({{< relref "/ChapterFour/0218.The-Skyline-Problem.md" >}})| Hard | O(n log n)| O(n)|❤️| -|307. Range Sum Query - Mutable | [Go]({{< relref "/ChapterFour/0307.Range-Sum-Query---Mutable.md" >}})| Hard | O(1)| O(n)|| -|315. Count of Smaller Numbers After Self | [Go]({{< relref "/ChapterFour/0315.Count-of-Smaller-Numbers-After-Self.md" >}})| Hard | O(n log n)| O(n)|| -|327. Count of Range Sum | [Go]({{< relref "/ChapterFour/0327.Count-of-Range-Sum.md" >}})| Hard | O(n log n)| O(n)|❤️| -|493. Reverse Pairs | [Go]({{< relref "/ChapterFour/0493.Reverse-Pairs.md" >}})| Hard | O(n log n)| O(n)|| -|699. Falling Squares | [Go]({{< relref "/ChapterFour/0699.Falling-Squares.md" >}})| Hard | O(n log n)| O(n)|❤️| -|715. Range Module | [Go]({{< relref "/ChapterFour/0715.Range-Module.md" >}})| Hard | O(log n)| O(n)|❤️| -|732. My Calendar III | [Go]({{< relref "/ChapterFour/0732.My-Calendar-III.md" >}})| Hard | O(log n)| O(n)|❤️| -|850. Rectangle Area II | [Go]({{< relref "/ChapterFour/0850.Rectangle-Area-II.md" >}})| Hard | O(n log n)| O(n)|❤️| -|1157. Online Majority Element In Subarray | [Go]({{< relref "/ChapterFour/1157.Online-Majority-Element-In-Subarray.md" >}})| Hard | O(log n)| O(n)|❤️| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0218.The-Skyline-Problem.md" >}})|Hard| O(n log n)| O(n)|❤️|36.1%| +|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0307.Range-Sum-Query---Mutable.md" >}})|Medium| O(1)| O(n)||36.5%| +|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard| O(n log n)| O(n)||42.6%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0327.Count-of-Range-Sum.md" >}})|Hard| O(n log n)| O(n)|❤️|35.9%| +|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0493.Reverse-Pairs.md" >}})|Hard| O(n log n)| O(n)||26.6%| +|0699|Falling Squares|[Go]({{< relref "/ChapterFour/0699.Falling-Squares.md" >}})|Hard| O(n log n)| O(n)|❤️|42.4%| +|0715|Range Module|[Go]({{< relref "/ChapterFour/0715.Range-Module.md" >}})|Hard| O(log n)| O(n)|❤️|40.0%| +|0732|My Calendar III|[Go]({{< relref "/ChapterFour/0732.My-Calendar-III.md" >}})|Hard| O(log n)| O(n)|❤️|61.4%| +|0850|Rectangle Area II|[Go]({{< relref "/ChapterFour/0850.Rectangle-Area-II.md" >}})|Hard| O(n log n)| O(n)|❤️|48.4%| +|1157|Online Majority Element In Subarray|[Go]({{< relref "/ChapterFour/1157.Online-Majority-Element-In-Subarray.md" >}})|Hard| O(log n)| O(n)|❤️|39.5%| +|1649|Create Sorted Array through Instructions|[Go]({{< relref "/ChapterFour/1649.Create-Sorted-Array-through-Instructions.md" >}})|Hard||||36.2%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Sliding_Window.md b/website/content/ChapterTwo/Sliding_Window.md index 2ffd90d7..709a3015 100644 --- a/website/content/ChapterTwo/Sliding_Window.md +++ b/website/content/ChapterTwo/Sliding_Window.md @@ -25,19 +25,22 @@ type: docs ``` - 滑动窗口经典题。第 239 题,第 480 题。 -| Title | Solution | Difficulty | Time | Space | 收藏 | -| ----- | :--------: | :----------: | :----: | :-----: |:-----: | -|3. Longest Substring Without Repeating Characters | [Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})| Medium | O(n)| O(1)|❤️| -|76. Minimum Window Substring | [Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})| Hard | O(n)| O(n)|❤️| -|239. Sliding Window Maximum | [Go]({{< relref "/ChapterFour/0239.Sliding-Window-Maximum.md" >}})| Hard | O(n * k)| O(n)|❤️| -|424. Longest Repeating Character Replacement | [Go]({{< relref "/ChapterFour/0424.Longest-Repeating-Character-Replacement.md" >}})| Medium | O(n)| O(1) || -|480. Sliding Window Median | [Go]({{< relref "/ChapterFour/0480.Sliding-Window-Median.md" >}})| Hard | O(n * log k)| O(k)|❤️| -|567. Permutation in String | [Go]({{< relref "/ChapterFour/0567.Permutation-in-String.md" >}})| Medium | O(n)| O(1)|❤️| -|978. Longest Turbulent Subarray | [Go]({{< relref "/ChapterFour/0978.Longest-Turbulent-Subarray.md" >}})| Medium | O(n)| O(1)|❤️| -|992. Subarrays with K Different Integers | [Go]({{< relref "/ChapterFour/0992.Subarrays-with-K-Different-Integers.md" >}})| Hard | O(n)| O(n)|❤️| -|995. Minimum Number of K Consecutive Bit Flips | [Go]({{< relref "/ChapterFour/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})| Hard | O(n)| O(1)|❤️| -|1004. Max Consecutive Ones III | [Go]({{< relref "/ChapterFour/1004.Max-Consecutive-Ones-III.md" >}})| Medium | O(n)| O(1) || -|1040. Moving Stones Until Consecutive II | [Go]({{< relref "/ChapterFour/1040.Moving-Stones-Until-Consecutive-II.md" >}})| Medium | O(n log n)| O(1) |❤️| -|1052. Grumpy Bookstore Owner | [Go]({{< relref "/ChapterFour/1052.Grumpy-Bookstore-Owner.md" >}})| Medium | O(n log n)| O(1) || -|1074. Number of Submatrices That Sum to Target | [Go]({{< relref "/ChapterFour/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})| Hard | O(n^3)| O(n) |❤️| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.3%| +|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|35.7%| +|0239|Sliding Window Maximum|[Go]({{< relref "/ChapterFour/0239.Sliding-Window-Maximum.md" >}})|Hard| O(n * k)| O(n)|❤️|44.5%| +|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium| O(n)| O(1) ||48.0%| +|0480|Sliding Window Median|[Go]({{< relref "/ChapterFour/0480.Sliding-Window-Median.md" >}})|Hard| O(n * log k)| O(k)|❤️|38.4%| +|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0567.Permutation-in-String.md" >}})|Medium| O(n)| O(1)|❤️|44.6%| +|0978|Longest Turbulent Subarray|[Go]({{< relref "/ChapterFour/0978.Longest-Turbulent-Subarray.md" >}})|Medium| O(n)| O(1)|❤️|46.6%| +|0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n)|❤️|50.4%| +|0995|Minimum Number of K Consecutive Bit Flips|[Go]({{< relref "/ChapterFour/0995.Minimum-Number-of-K-Consecutive-Bit-Flips.md" >}})|Hard| O(n)| O(1)|❤️|49.6%| +|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1004.Max-Consecutive-Ones-III.md" >}})|Medium| O(n)| O(1) ||60.5%| +|1040|Moving Stones Until Consecutive II|[Go]({{< relref "/ChapterFour/1040.Moving-Stones-Until-Consecutive-II.md" >}})|Medium| O(n log n)| O(1) |❤️|54.0%| +|1052|Grumpy Bookstore Owner|[Go]({{< relref "/ChapterFour/1052.Grumpy-Bookstore-Owner.md" >}})|Medium| O(n log n)| O(1) ||55.6%| +|1074|Number of Submatrices That Sum to Target|[Go]({{< relref "/ChapterFour/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}})|Hard| O(n^3)| O(n) |❤️|61.4%| +|1208|Get Equal Substrings Within Budget|[Go]({{< relref "/ChapterFour/1208.Get-Equal-Substrings-Within-Budget.md" >}})|Medium||||43.7%| +|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.6%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Sort.md b/website/content/ChapterTwo/Sort.md index f759edf8..f4dc0947 100644 --- a/website/content/ChapterTwo/Sort.md +++ b/website/content/ChapterTwo/Sort.md @@ -14,29 +14,39 @@ type: docs - 两两不相邻的排序。第 767 题,第 1054 题。 - "饼子排序"。第 969 题。 -| Title | Solution | Difficulty | Time | Space | 收藏 | -| ----- | :--------: | :----------: | :----: | :-----: |:-----: | -|56. Merge Intervals | [Go]({{< relref "/ChapterFour/0056.Merge-Intervals.md" >}})| Medium | O(n log n)| O(log n)|| -|57. Insert Interval | [Go]({{< relref "/ChapterFour/0057.Insert-Interval.md" >}})| Hard | O(n)| O(1)|| -|75. Sort Colors | [Go]({{< relref "/ChapterFour/0075.Sort-Colors.md" >}})| Medium| O(n)| O(1)|❤️| -|147. Insertion Sort List | [Go]({{< relref "/ChapterFour/0147.Insertion-Sort-List.md" >}})| Medium | O(n)| O(1) |❤️| -|148. Sort List | [Go]({{< relref "/ChapterFour/0148.Sort-List.md" >}})| Medium |O(n log n)| O(log n)|❤️| -|164. Maximum Gap | [Go]({{< relref "/ChapterFour/0164.Maximum-Gap.md" >}})| Hard | O(n log n)| O(log n) |❤️| -|179. Largest Number | [Go]({{< relref "/ChapterFour/0179.Largest-Number.md" >}})| Medium | O(n log n)| O(log n) |❤️| -|220. Contains Duplicate III | [Go]({{< relref "/ChapterFour/0220.Contains-Duplicate-III.md" >}})| Medium | O(n log n)| O(1) |❤️| -|242. Valid Anagram | [Go]({{< relref "/ChapterFour/0242.Valid-Anagram.md" >}})| Easy | O(n)| O(n) || -|274. H-Index | [Go]({{< relref "/ChapterFour/0274.H-Index.md" >}})| Medium | O(n)| O(n) || -|324. Wiggle Sort II | [Go]({{< relref "/ChapterFour/0324.Wiggle-Sort-II.md" >}})| Medium| O(n)| O(n)|❤️| -|349. Intersection of Two Arrays | [Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})| Easy | O(n)| O(n) || -|350. Intersection of Two Arrays II | [Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})| Easy | O(n)| O(n) || -|524. Longest Word in Dictionary through Deleting | [Go]({{< relref "/ChapterFour/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})| Medium | O(n)| O(1) || -|767. Reorganize String | [Go]({{< relref "/ChapterFour/0767.Reorganize-String.md" >}})| Medium | O(n log n)| O(log n) |❤️| -|853. Car Fleet | [Go]({{< relref "/ChapterFour/0853.Car-Fleet.md" >}})| Medium | O(n log n)| O(log n) || -|710. Random Pick with Blacklist | [Go]({{< relref "/ChapterFour/0710.Random-Pick-with-Blacklist.md" >}})| Hard | O(n)| O(n) || -|922. Sort Array By Parity II | [Go]({{< relref "/ChapterFour/0922.Sort-Array-By-Parity-II.md" >}})| Easy | O(n)| O(1) || -|969. Pancake Sorting | [Go]({{< relref "/ChapterFour/0969.Pancake-Sorting.md" >}})| Medium | O(n log n)| O(log n) |❤️| -|973. K Closest Points to Origin | [Go]({{< relref "/ChapterFour/0973.K-Closest-Points-to-Origin.md" >}})| Medium | O(n log n)| O(log n) || -|976. Largest Perimeter Triangle | [Go]({{< relref "/ChapterFour/0976.Largest-Perimeter-Triangle.md" >}})| Easy | O(n log n)| O(log n) || -|1030. Matrix Cells in Distance Order | [Go]({{< relref "/ChapterFour/1030.Matrix-Cells-in-Distance-Order.md" >}})| Easy | O(n^2)| O(1) || -|1054. Distant Barcodes | [Go]({{< relref "/ChapterFour/1054.Distant-Barcodes.md" >}})| Medium | O(n log n)| O(log n) |❤️| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0056|Merge Intervals|[Go]({{< relref "/ChapterFour/0056.Merge-Intervals.md" >}})|Medium| O(n log n)| O(log n)||40.7%| +|0057|Insert Interval|[Go]({{< relref "/ChapterFour/0057.Insert-Interval.md" >}})|Medium| O(n)| O(1)||34.8%| +|0075|Sort Colors|[Go]({{< relref "/ChapterFour/0075.Sort-Colors.md" >}})|Medium| O(n)| O(1)|❤️|48.9%| +|0147|Insertion Sort List|[Go]({{< relref "/ChapterFour/0147.Insertion-Sort-List.md" >}})|Medium| O(n)| O(1) |❤️|44.1%| +|0148|Sort List|[Go]({{< relref "/ChapterFour/0148.Sort-List.md" >}})|Medium|O(n log n)| O(log n)|❤️|45.8%| +|0164|Maximum Gap|[Go]({{< relref "/ChapterFour/0164.Maximum-Gap.md" >}})|Hard| O(n log n)| O(log n) |❤️|36.6%| +|0179|Largest Number|[Go]({{< relref "/ChapterFour/0179.Largest-Number.md" >}})|Medium| O(n log n)| O(log n) |❤️|30.4%| +|0220|Contains Duplicate III|[Go]({{< relref "/ChapterFour/0220.Contains-Duplicate-III.md" >}})|Medium| O(n log n)| O(1) |❤️|21.3%| +|0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0242.Valid-Anagram.md" >}})|Easy| O(n)| O(n) ||57.9%| +|0274|H-Index|[Go]({{< relref "/ChapterFour/0274.H-Index.md" >}})|Medium| O(n)| O(n) ||36.3%| +|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.6%| +|0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0324.Wiggle-Sort-II.md" >}})|Medium| O(n)| O(n)|❤️|30.5%| +|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0327.Count-of-Range-Sum.md" >}})|Hard||||35.9%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.4%| +|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||51.9%| +|0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0493.Reverse-Pairs.md" >}})|Hard||||26.6%| +|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium| O(n)| O(1) ||48.9%| +|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||32.7%| +|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|49.9%| +|0853|Car Fleet|[Go]({{< relref "/ChapterFour/0853.Car-Fleet.md" >}})|Medium| O(n log n)| O(log n) ||43.6%| +|0922|Sort Array By Parity II|[Go]({{< relref "/ChapterFour/0922.Sort-Array-By-Parity-II.md" >}})|Easy| O(n)| O(1) ||70.2%| +|0969|Pancake Sorting|[Go]({{< relref "/ChapterFour/0969.Pancake-Sorting.md" >}})|Medium| O(n log n)| O(log n) |❤️|68.5%| +|0973|K Closest Points to Origin|[Go]({{< relref "/ChapterFour/0973.K-Closest-Points-to-Origin.md" >}})|Medium| O(n log n)| O(log n) ||64.5%| +|0976|Largest Perimeter Triangle|[Go]({{< relref "/ChapterFour/0976.Largest-Perimeter-Triangle.md" >}})|Easy| O(n log n)| O(log n) ||58.5%| +|1030|Matrix Cells in Distance Order|[Go]({{< relref "/ChapterFour/1030.Matrix-Cells-in-Distance-Order.md" >}})|Easy| O(n^2)| O(1) ||66.9%| +|1054|Distant Barcodes|[Go]({{< relref "/ChapterFour/1054.Distant-Barcodes.md" >}})|Medium| O(n log n)| O(log n) |❤️|44.2%| +|1122|Relative Sort Array|[Go]({{< relref "/ChapterFour/1122.Relative-Sort-Array.md" >}})|Easy||||67.7%| +|1235|Maximum Profit in Job Scheduling|[Go]({{< relref "/ChapterFour/1235.Maximum-Profit-in-Job-Scheduling.md" >}})|Hard||||46.9%| +|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||77.8%| +|1640|Check Array Formation Through Concatenation|[Go]({{< relref "/ChapterFour/1640.Check-Array-Formation-Through-Concatenation.md" >}})|Easy||||62.3%| +|1647|Minimum Deletions to Make Character Frequencies Unique|[Go]({{< relref "/ChapterFour/1647.Minimum-Deletions-to-Make-Character-Frequencies-Unique.md" >}})|Medium||||53.9%| +|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||30.9%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Stack.md b/website/content/ChapterTwo/Stack.md index cae1b29c..192775aa 100644 --- a/website/content/ChapterTwo/Stack.md +++ b/website/content/ChapterTwo/Stack.md @@ -12,43 +12,47 @@ type: docs - 利用栈进行编码问题。第 394 题,第 682 题,第 856 题,第 880 题。 - **单调栈**。**利用栈维护一个单调递增或者递减的下标数组**。第 84 题,第 456 题,第 496 题,第 503 题,第 739 题,第 901 题,第 907 题,第 1019 题。 -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|20. Valid Parentheses | [Go]({{< relref "/ChapterFour/0020.Valid-Parentheses.md" >}})| Easy | O(log n)| O(1)|| -|42. Trapping Rain Water | [Go]({{< relref "/ChapterFour/0042.Trapping-Rain-Water.md" >}})| Hard | O(n)| O(1)|❤️| -|71. Simplify Path | [Go]({{< relref "/ChapterFour/0071.Simplify-Path.md" >}})| Medium | O(n)| O(n)|❤️| -|84. Largest Rectangle in Histogram | [Go]({{< relref "/ChapterFour/0084.Largest-Rectangle-in-Histogram.md" >}})| Medium | O(n)| O(n)|❤️| -|94. Binary Tree Inorder Traversal | [Go]({{< relref "/ChapterFour/0094.Binary-Tree-Inorder-Traversal.md" >}})| Medium | O(n)| O(1)|| -|103. Binary Tree Zigzag Level Order Traversal | [Go]({{< relref "/ChapterFour/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})| Medium | O(n)| O(n)|| -|144. Binary Tree Preorder Traversal | [Go]({{< relref "/ChapterFour/0144.Binary-Tree-Preorder-Traversal.md" >}})| Medium | O(n)| O(1)|| -|145. Binary Tree Postorder Traversal | [Go]({{< relref "/ChapterFour/0145.Binary-Tree-Postorder-Traversal.md" >}})| Hard | O(n)| O(1)|| -|150. Evaluate Reverse Polish Notation | [Go]({{< relref "/ChapterFour/0150.Evaluate-Reverse-Polish-Notation.md" >}})| Medium | O(n)| O(1)|| -|155. Min Stack | [Go]({{< relref "/ChapterFour/0155.Min-Stack.md" >}})| Easy | O(n)| O(n)|| -|173. Binary Search Tree Iterator | [Go]({{< relref "/ChapterFour/0173.Binary-Search-Tree-Iterator.md" >}})| Medium | O(n)| O(1)|| -|224. Basic Calculator | [Go]({{< relref "/ChapterFour/0224.Basic-Calculator.md" >}})| Hard | O(n)| O(n)|| -|225. Implement Stack using Queues | [Go]({{< relref "/ChapterFour/0225.Implement-Stack-using-Queues.md" >}})| Easy | O(n)| O(n)|| -|232. Implement Queue using Stacks | [Go]({{< relref "/ChapterFour/0232.Implement-Queue-using-Stacks.md" >}})| Easy | O(n)| O(n)|| -|331. Verify Preorder Serialization of a Binary Tree | [Go]({{< relref "/ChapterFour/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})| Medium | O(n)| O(1)|| -|394. Decode String | [Go]({{< relref "/ChapterFour/0394.Decode-String.md" >}})| Medium | O(n)| O(n)|| -|402. Remove K Digits | [Go]({{< relref "/ChapterFour/0402.Remove-K-Digits.md" >}})| Medium | O(n)| O(1)|| -|456. 132 Pattern | [Go]({{< relref "/ChapterFour/0456.132-Pattern.md" >}})| Medium | O(n)| O(n)|| -|496. Next Greater Element I | [Go]({{< relref "/ChapterFour/0496.Next-Greater-Element-I.md" >}})| Easy | O(n)| O(n)|| -|503. Next Greater Element II | [Go]({{< relref "/ChapterFour/0503.Next-Greater-Element-II.md" >}})| Medium | O(n)| O(n)|| -|636. Exclusive Time of Functions | [Go]({{< relref "/ChapterFour/0636.Exclusive-Time-of-Functions.md" >}})| Medium | O(n)| O(n)|| -|682. Baseball Game | [Go]({{< relref "/ChapterFour/0682.Baseball-Game.md" >}})| Easy | O(n)| O(n)|| -|726. Number of Atoms | [Go]({{< relref "/ChapterFour/0726.Number-of-Atoms.md" >}})| Hard | O(n)| O(n) |❤️| -|735. Asteroid Collision | [Go]({{< relref "/ChapterFour/0735.Asteroid-Collision.md" >}})| Medium | O(n)| O(n) || -|739. Daily Temperatures | [Go]({{< relref "/ChapterFour/0739.Daily-Temperatures.md" >}})| Medium | O(n)| O(n) || -|844. Backspace String Compare | [Go]({{< relref "/ChapterFour/0844.Backspace-String-Compare.md" >}})| Easy | O(n)| O(n) || -|856. Score of Parentheses | [Go]({{< relref "/ChapterFour/0856.Score-of-Parentheses.md" >}})| Medium | O(n)| O(n)|| -|880. Decoded String at Index | [Go]({{< relref "/ChapterFour/0880.Decoded-String-at-Index.md" >}})| Medium | O(n)| O(n)|| -|895. Maximum Frequency Stack | [Go]({{< relref "/ChapterFour/0895.Maximum-Frequency-Stack.md" >}})| Hard | O(n)| O(n) || -|901. Online Stock Span | [Go]({{< relref "/ChapterFour/0901.Online-Stock-Span.md" >}})| Medium | O(n)| O(n) || -|907. Sum of Subarray Minimums | [Go]({{< relref "/ChapterFour/0907.Sum-of-Subarray-Minimums.md" >}})| Medium | O(n)| O(n)|❤️| -|921. Minimum Add to Make Parentheses Valid | [Go]({{< relref "/ChapterFour/0921.Minimum-Add-to-Make-Parentheses-Valid.md" >}})| Medium | O(n)| O(n)|| -|946. Validate Stack Sequences | [Go]({{< relref "/ChapterFour/0946.Validate-Stack-Sequences.md" >}})| Medium | O(n)| O(n)|| -|1003. Check If Word Is Valid After Substitutions | [Go]({{< relref "/ChapterFour/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})| Medium | O(n)| O(1)|| -|1019. Next Greater Node In Linked List | [Go]({{< relref "/ChapterFour/1019.Next-Greater-Node-In-Linked-List.md" >}})| Medium | O(n)| O(1)|| -|1021. Remove Outermost Parentheses | [Go]({{< relref "/ChapterFour/1021.Remove-Outermost-Parentheses.md" >}})| Medium | O(n)| O(1)|| -|1047. Remove All Adjacent Duplicates In String | [Go]({{< relref "/ChapterFour/1047.Remove-All-Adjacent-Duplicates-In-String.md" >}})| Medium | O(n)| O(1)|| -|---------------------------------------|-----------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0020|Valid Parentheses|[Go]({{< relref "/ChapterFour/0020.Valid-Parentheses.md" >}})|Easy| O(log n)| O(1)||39.5%| +|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0042.Trapping-Rain-Water.md" >}})|Hard| O(n)| O(1)|❤️|50.7%| +|0071|Simplify Path|[Go]({{< relref "/ChapterFour/0071.Simplify-Path.md" >}})|Medium| O(n)| O(n)|❤️|33.6%| +|0084|Largest Rectangle in Histogram|[Go]({{< relref "/ChapterFour/0084.Largest-Rectangle-in-Histogram.md" >}})|Hard| O(n)| O(n)|❤️|36.8%| +|0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0094.Binary-Tree-Inorder-Traversal.md" >}})|Medium| O(n)| O(1)||65.4%| +|0103|Binary Tree Zigzag Level Order Traversal|[Go]({{< relref "/ChapterFour/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})|Medium| O(n)| O(n)||49.8%| +|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0144.Binary-Tree-Preorder-Traversal.md" >}})|Medium| O(n)| O(1)||57.1%| +|0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0145.Binary-Tree-Postorder-Traversal.md" >}})|Medium| O(n)| O(1)||57.1%| +|0150|Evaluate Reverse Polish Notation|[Go]({{< relref "/ChapterFour/0150.Evaluate-Reverse-Polish-Notation.md" >}})|Medium| O(n)| O(1)||37.6%| +|0155|Min Stack|[Go]({{< relref "/ChapterFour/0155.Min-Stack.md" >}})|Easy| O(n)| O(n)||46.0%| +|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||59.6%| +|0224|Basic Calculator|[Go]({{< relref "/ChapterFour/0224.Basic-Calculator.md" >}})|Hard| O(n)| O(n)||38.0%| +|0225|Implement Stack using Queues|[Go]({{< relref "/ChapterFour/0225.Implement-Stack-using-Queues.md" >}})|Easy| O(n)| O(n)||46.9%| +|0232|Implement Queue using Stacks|[Go]({{< relref "/ChapterFour/0232.Implement-Queue-using-Stacks.md" >}})|Easy| O(n)| O(n)||51.6%| +|0331|Verify Preorder Serialization of a Binary Tree|[Go]({{< relref "/ChapterFour/0331.Verify-Preorder-Serialization-of-a-Binary-Tree.md" >}})|Medium| O(n)| O(1)||40.9%| +|0385|Mini Parser|[Go]({{< relref "/ChapterFour/0385.Mini-Parser.md" >}})|Medium||||34.3%| +|0394|Decode String|[Go]({{< relref "/ChapterFour/0394.Decode-String.md" >}})|Medium| O(n)| O(n)||52.3%| +|0402|Remove K Digits|[Go]({{< relref "/ChapterFour/0402.Remove-K-Digits.md" >}})|Medium| O(n)| O(1)||28.6%| +|0456|132 Pattern|[Go]({{< relref "/ChapterFour/0456.132-Pattern.md" >}})|Medium| O(n)| O(n)||30.6%| +|0496|Next Greater Element I|[Go]({{< relref "/ChapterFour/0496.Next-Greater-Element-I.md" >}})|Easy| O(n)| O(n)||65.1%| +|0503|Next Greater Element II|[Go]({{< relref "/ChapterFour/0503.Next-Greater-Element-II.md" >}})|Medium| O(n)| O(n)||58.1%| +|0636|Exclusive Time of Functions|[Go]({{< relref "/ChapterFour/0636.Exclusive-Time-of-Functions.md" >}})|Medium| O(n)| O(n)||53.9%| +|0682|Baseball Game|[Go]({{< relref "/ChapterFour/0682.Baseball-Game.md" >}})|Easy| O(n)| O(n)||66.1%| +|0726|Number of Atoms|[Go]({{< relref "/ChapterFour/0726.Number-of-Atoms.md" >}})|Hard| O(n)| O(n) |❤️|51.0%| +|0735|Asteroid Collision|[Go]({{< relref "/ChapterFour/0735.Asteroid-Collision.md" >}})|Medium| O(n)| O(n) ||43.2%| +|0739|Daily Temperatures|[Go]({{< relref "/ChapterFour/0739.Daily-Temperatures.md" >}})|Medium| O(n)| O(n) ||64.3%| +|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||46.8%| +|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||62.2%| +|0880|Decoded String at Index|[Go]({{< relref "/ChapterFour/0880.Decoded-String-at-Index.md" >}})|Medium| O(n)| O(n)||28.3%| +|0895|Maximum Frequency Stack|[Go]({{< relref "/ChapterFour/0895.Maximum-Frequency-Stack.md" >}})|Hard| O(n)| O(n) ||62.1%| +|0901|Online Stock Span|[Go]({{< relref "/ChapterFour/0901.Online-Stock-Span.md" >}})|Medium| O(n)| O(n) ||61.1%| +|0907|Sum of Subarray Minimums|[Go]({{< relref "/ChapterFour/0907.Sum-of-Subarray-Minimums.md" >}})|Medium| O(n)| O(n)|❤️|33.2%| +|0921|Minimum Add to Make Parentheses Valid|[Go]({{< relref "/ChapterFour/0921.Minimum-Add-to-Make-Parentheses-Valid.md" >}})|Medium| O(n)| O(n)||74.6%| +|0946|Validate Stack Sequences|[Go]({{< relref "/ChapterFour/0946.Validate-Stack-Sequences.md" >}})|Medium| O(n)| O(n)||63.4%| +|1003|Check If Word Is Valid After Substitutions|[Go]({{< relref "/ChapterFour/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})|Medium| O(n)| O(1)||56.1%| +|1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium| O(n)| O(1)||58.2%| +|1021|Remove Outermost Parentheses|[Go]({{< relref "/ChapterFour/1021.Remove-Outermost-Parentheses.md" >}})|Easy| O(n)| O(1)||78.7%| +|1047|Remove All Adjacent Duplicates In String|[Go]({{< relref "/ChapterFour/1047.Remove-All-Adjacent-Duplicates-In-String.md" >}})|Easy| O(n)| O(1)||70.2%| +|1673|Find the Most Competitive Subsequence|[Go]({{< relref "/ChapterFour/1673.Find-the-Most-Competitive-Subsequence.md" >}})|Medium||||38.3%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/String.md b/website/content/ChapterTwo/String.md index 1ea29de5..d129d222 100644 --- a/website/content/ChapterTwo/String.md +++ b/website/content/ChapterTwo/String.md @@ -5,26 +5,50 @@ type: docs # String -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|3. Longest Substring Without Repeating Characters | [Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})| Medium | O(n)| O(1)|❤️| -|17. Letter Combinations of a Phone Number | [Go]({{< relref "/ChapterFour/0017.Letter-Combinations-of-a-Phone-Number.md" >}})| Medium | O(log n)| O(1)|| -|20. Valid Parentheses | [Go]({{< relref "/ChapterFour/0020.Valid-Parentheses.md" >}})| Easy | O(log n)| O(1)|| -|22. Generate Parentheses | [Go]({{< relref "/ChapterFour/0022.Generate-Parentheses.md" >}})| Medium | O(log n)| O(1)|| -|28. Implement strStr() | [Go]({{< relref "/ChapterFour/0028.Implement-strStr.md" >}})| Easy | O(n)| O(1)|| -|30. Substring with Concatenation of All Words | [Go]({{< relref "/ChapterFour/0030.Substring-with-Concatenation-of-All-Words.md" >}})| Hard | O(n)| O(n)|❤️| -|49. Group Anagrams | [Go]({{< relref "/ChapterFour/0049.Group-Anagrams.md" >}})| Medium | O(n log n)| O(n)|| -|71. Simplify Path | [Go]({{< relref "/ChapterFour/0071.Simplify-Path.md" >}})| Medium | O(n)| O(n)|| -|76. Minimum Window Substring | [Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})| Hard | O(n)| O(n)|❤️| -|91. Decode Ways | [Go]({{< relref "/ChapterFour/0091.Decode-Ways.md" >}})| Medium | O(n)| O(n)|| -|93. Restore IP Addresses | [Go]({{< relref "/ChapterFour/0093.Restore-IP-Addresses.md" >}})| Medium | O(n)| O(n)|❤️| -|125. Valid Palindrome | [Go]({{< relref "/ChapterFour/0125.Valid-Palindrome.md" >}})| Easy | O(n)| O(1)|| -|126. Word Ladder II | [Go]({{< relref "/ChapterFour/0126.Word-Ladder-II.md" >}})| Hard | O(n)| O(n^2)|❤️| -|344. Reverse String | [Go]({{< relref "/ChapterFour/0344.Reverse-String.md" >}})| Easy | O(n)| O(1)|| -|345. Reverse Vowels of a String | [Go]({{< relref "/ChapterFour/0345.Reverse-Vowels-of-a-String.md" >}})| Easy | O(n)| O(1)|| -|767. Reorganize String | [Go]({{< relref "/ChapterFour/0767.Reorganize-String.md" >}})| Medium | O(n log n)| O(log n) |❤️| -|842. Split Array into Fibonacci Sequence | [Go]({{< relref "/ChapterFour/0842.Split-Array-into-Fibonacci-Sequence.md" >}})| Medium | O(n^2)| O(1)|❤️| -|856. Score of Parentheses | [Go]({{< relref "/ChapterFour/0856.Score-of-Parentheses.md" >}})| Medium | O(n)| O(n)|| -|925. Long Pressed Name | [Go]({{< relref "/ChapterFour/0925.Long-Pressed-Name.md" >}})| Easy | O(n)| O(1)|| -|1003. Check If Word Is Valid After Substitutions | [Go]({{< relref "/ChapterFour/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})| Medium | O(n)| O(1)|| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.3%| +|0013|Roman to Integer|[Go]({{< relref "/ChapterFour/0013.Roman-to-Integer.md" >}})|Easy||||56.4%| +|0017|Letter Combinations of a Phone Number|[Go]({{< relref "/ChapterFour/0017.Letter-Combinations-of-a-Phone-Number.md" >}})|Medium| O(log n)| O(1)||48.6%| +|0020|Valid Parentheses|[Go]({{< relref "/ChapterFour/0020.Valid-Parentheses.md" >}})|Easy| O(log n)| O(1)||39.5%| +|0022|Generate Parentheses|[Go]({{< relref "/ChapterFour/0022.Generate-Parentheses.md" >}})|Medium| O(log n)| O(1)||64.8%| +|0028|Implement strStr()|[Go]({{< relref "/ChapterFour/0028.Implement-strStr.md" >}})|Easy| O(n)| O(1)||35.0%| +|0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard| O(n)| O(n)|❤️|26.0%| +|0049|Group Anagrams|[Go]({{< relref "/ChapterFour/0049.Group-Anagrams.md" >}})|Medium| O(n log n)| O(n)||58.8%| +|0067|Add Binary|[Go]({{< relref "/ChapterFour/0067.Add-Binary.md" >}})|Easy||||46.6%| +|0071|Simplify Path|[Go]({{< relref "/ChapterFour/0071.Simplify-Path.md" >}})|Medium| O(n)| O(n)||33.6%| +|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|35.7%| +|0091|Decode Ways|[Go]({{< relref "/ChapterFour/0091.Decode-Ways.md" >}})|Medium| O(n)| O(n)||26.2%| +|0093|Restore IP Addresses|[Go]({{< relref "/ChapterFour/0093.Restore-IP-Addresses.md" >}})|Medium| O(n)| O(n)|❤️|37.2%| +|0125|Valid Palindrome|[Go]({{< relref "/ChapterFour/0125.Valid-Palindrome.md" >}})|Easy| O(n)| O(1)||37.9%| +|0126|Word Ladder II|[Go]({{< relref "/ChapterFour/0126.Word-Ladder-II.md" >}})|Hard| O(n)| O(n^2)|❤️|23.4%| +|0151|Reverse Words in a String|[Go]({{< relref "/ChapterFour/0151.Reverse-Words-in-a-String.md" >}})|Medium||||23.3%| +|0344|Reverse String|[Go]({{< relref "/ChapterFour/0344.Reverse-String.md" >}})|Easy| O(n)| O(1)||70.0%| +|0345|Reverse Vowels of a String|[Go]({{< relref "/ChapterFour/0345.Reverse-Vowels-of-a-String.md" >}})|Easy| O(n)| O(1)||44.9%| +|0385|Mini Parser|[Go]({{< relref "/ChapterFour/0385.Mini-Parser.md" >}})|Medium||||34.3%| +|0387|First Unique Character in a String|[Go]({{< relref "/ChapterFour/0387.First-Unique-Character-in-a-String.md" >}})|Easy||||53.7%| +|0537|Complex Number Multiplication|[Go]({{< relref "/ChapterFour/0537.Complex-Number-Multiplication.md" >}})|Medium||||68.3%| +|0541|Reverse String II|[Go]({{< relref "/ChapterFour/0541.Reverse-String-II.md" >}})|Easy||||49.0%| +|0557|Reverse Words in a String III|[Go]({{< relref "/ChapterFour/0557.Reverse-Words-in-a-String-III.md" >}})|Easy||||71.5%| +|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||53.9%| +|0767|Reorganize String|[Go]({{< relref "/ChapterFour/0767.Reorganize-String.md" >}})|Medium| O(n log n)| O(log n) |❤️|49.9%| +|0819|Most Common Word|[Go]({{< relref "/ChapterFour/0819.Most-Common-Word.md" >}})|Easy||||45.4%| +|0842|Split Array into Fibonacci Sequence|[Go]({{< relref "/ChapterFour/0842.Split-Array-into-Fibonacci-Sequence.md" >}})|Medium| O(n^2)| O(1)|❤️|36.7%| +|0856|Score of Parentheses|[Go]({{< relref "/ChapterFour/0856.Score-of-Parentheses.md" >}})|Medium| O(n)| O(n)||62.2%| +|0925|Long Pressed Name|[Go]({{< relref "/ChapterFour/0925.Long-Pressed-Name.md" >}})|Easy| O(n)| O(1)||38.4%| +|1003|Check If Word Is Valid After Substitutions|[Go]({{< relref "/ChapterFour/1003.Check-If-Word-Is-Valid-After-Substitutions.md" >}})|Medium| O(n)| O(1)||56.1%| +|1108|Defanging an IP Address|[Go]({{< relref "/ChapterFour/1108.Defanging-an-IP-Address.md" >}})|Easy||||88.5%| +|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Easy||||59.5%| +|1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||61.8%| +|1221|Split a String in Balanced Strings|[Go]({{< relref "/ChapterFour/1221.Split-a-String-in-Balanced-Strings.md" >}})|Easy||||84.0%| +|1234|Replace the Substring for Balanced String|[Go]({{< relref "/ChapterFour/1234.Replace-the-Substring-for-Balanced-String.md" >}})|Medium||||34.4%| +|1455|Check If a Word Occurs As a Prefix of Any Word in a Sentence|[Go]({{< relref "/ChapterFour/1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence.md" >}})|Easy||||64.7%| +|1573|Number of Ways to Split a String|[Go]({{< relref "/ChapterFour/1573.Number-of-Ways-to-Split-a-String.md" >}})|Medium||||30.8%| +|1653|Minimum Deletions to Make String Balanced|[Go]({{< relref "/ChapterFour/1653.Minimum-Deletions-to-Make-String-Balanced.md" >}})|Medium||||49.7%| +|1662|Check If Two String Arrays are Equivalent|[Go]({{< relref "/ChapterFour/1662.Check-If-Two-String-Arrays-are-Equivalent.md" >}})|Easy||||83.7%| +|1668|Maximum Repeating Substring|[Go]({{< relref "/ChapterFour/1668.Maximum-Repeating-Substring.md" >}})|Easy||||38.7%| +|1678|Goal Parser Interpretation|[Go]({{< relref "/ChapterFour/1678.Goal-Parser-Interpretation.md" >}})|Easy||||86.7%| +|1684|Count the Number of Consistent Strings|[Go]({{< relref "/ChapterFour/1684.Count-the-Number-of-Consistent-Strings.md" >}})|Easy||||84.2%| +|1694|Reformat Phone Number|[Go]({{< relref "/ChapterFour/1694.Reformat-Phone-Number.md" >}})|Easy||||67.1%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Tree.md b/website/content/ChapterTwo/Tree.md index d8a1267e..352ddefa 100644 --- a/website/content/ChapterTwo/Tree.md +++ b/website/content/ChapterTwo/Tree.md @@ -5,39 +5,65 @@ type: docs # Tree -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|94. Binary Tree Inorder Traversal | [Go]({{< relref "/ChapterFour/0094.Binary-Tree-Inorder-Traversal.md" >}})| Medium | O(n)| O(1)|| -|96. Unique Binary Search Trees | [Go]({{< relref "/ChapterFour/0096.Unique-Binary-Search-Trees.md" >}})| Medium | O(n^2)| O(n)|| -|98. Validate Binary Search Tree | [Go]({{< relref "/ChapterFour/0098.Validate-Binary-Search-Tree.md" >}})| Medium | O(n)| O(1)|| -|99. Recover Binary Search Tree | [Go]({{< relref "/ChapterFour/0099.Recover-Binary-Search-Tree.md" >}})| Hard | O(n)| O(1)|| -|100. Same Tree | [Go]({{< relref "/ChapterFour/0100.Same-Tree.md" >}})| Easy | O(n)| O(1)|| -|101. Symmetric Tree | [Go]({{< relref "/ChapterFour/0101.Symmetric-Tree.md" >}})| Easy | O(n)| O(1)|| -|102. Binary Tree Level Order Traversal | [Go]({{< relref "/ChapterFour/0102.Binary-Tree-Level-Order-Traversal.md" >}})| Medium | O(n)| O(1)|| -|103. Binary Tree Zigzag Level Order Traversal | [Go]({{< relref "/ChapterFour/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})| Medium | O(n)| O(n)|| -|104. Maximum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0104.Maximum-Depth-of-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|107. Binary Tree Level Order Traversal II | [Go]({{< relref "/ChapterFour/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})| Easy | O(n)| O(1)|| -|108. Convert Sorted Array to Binary Search Tree | [Go]({{< relref "/ChapterFour/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})| Easy | O(n)| O(1)|| -|110. Balanced Binary Tree | [Go]({{< relref "/ChapterFour/0110.Balanced-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|111. Minimum Depth of Binary Tree | [Go]({{< relref "/ChapterFour/0111.Minimum-Depth-of-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|112. Path Sum | [Go]({{< relref "/ChapterFour/0112.Path-Sum.md" >}})| Easy | O(n)| O(1)|| -|113. Path Sum II | [Go]({{< relref "/ChapterFour/0113.Path-Sum-II.md" >}})| Medium | O(n)| O(1)|| -|114. Flatten Binary Tree to Linked List | [Go]({{< relref "/ChapterFour/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})| Medium | O(n)| O(1)|| -|124. Binary Tree Maximum Path Sum | [Go]({{< relref "/ChapterFour/0124.Binary-Tree-Maximum-Path-Sum.md" >}})| Hard | O(n)| O(1)|| -|129. Sum Root to Leaf Numbers | [Go]({{< relref "/ChapterFour/0129.Sum-Root-to-Leaf-Numbers.md" >}})| Medium | O(n)| O(1)|| -|144. Binary Tree Preorder Traversal | [Go]({{< relref "/ChapterFour/0144.Binary-Tree-Preorder-Traversal.md" >}})| Medium | O(n)| O(1)|| -|145. Binary Tree Postorder Traversal | [Go]({{< relref "/ChapterFour/0145.Binary-Tree-Postorder-Traversal.md" >}})| Hard | O(n)| O(1)|| -|173. Binary Search Tree Iterator | [Go]({{< relref "/ChapterFour/0173.Binary-Search-Tree-Iterator.md" >}})| Medium | O(n)| O(1)|| -|199. Binary Tree Right Side View | [Go]({{< relref "/ChapterFour/0199.Binary-Tree-Right-Side-View.md" >}})| Medium | O(n)| O(1)|| -|222. Count Complete Tree Nodes | [Go]({{< relref "/ChapterFour/0222.Count-Complete-Tree-Nodes.md" >}})| Medium | O(n)| O(1)|| -|226. Invert Binary Tree | [Go]({{< relref "/ChapterFour/0226.Invert-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|230. Kth Smallest Element in a BST | [Go]({{< relref "/ChapterFour/0230.Kth-Smallest-Element-in-a-BST.md" >}})| Medium | O(n)| O(1)|| -|235. Lowest Common Ancestor of a Binary Search Tree | [Go]({{< relref "/ChapterFour/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree.md" >}})| Easy | O(n)| O(1)|| -|236. Lowest Common Ancestor of a Binary Tree | [Go]({{< relref "/ChapterFour/0236.Lowest-Common-Ancestor-of-a-Binary-Tree.md" >}})| Medium | O(n)| O(1)|| -|257. Binary Tree Paths | [Go]({{< relref "/ChapterFour/0257.Binary-Tree-Paths.md" >}})| Easy | O(n)| O(1)|| -|404. Sum of Left Leaves | [Go]({{< relref "/ChapterFour/0404.Sum-of-Left-Leaves.md" >}})| Easy | O(n)| O(1)|| -|437. Path Sum III | [Go]({{< relref "/ChapterFour/0437.Path-Sum-III.md" >}})| Easy | O(n)| O(1)|| -|515. Find Largest Value in Each Tree Row | [Go]({{< relref "/ChapterFour/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})| Medium | O(n)| O(n)|| -|637. Average of Levels in Binary Tree | [Go]({{< relref "/ChapterFour/0637.Average-of-Levels-in-Binary-Tree.md" >}})| Easy | O(n)| O(n)|| -|993. Cousins in Binary Tree | [Go]({{< relref "/ChapterFour/0993.Cousins-in-Binary-Tree.md" >}})| Easy | O(n)| O(1)|| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0094|Binary Tree Inorder Traversal|[Go]({{< relref "/ChapterFour/0094.Binary-Tree-Inorder-Traversal.md" >}})|Medium| O(n)| O(1)||65.4%| +|0095|Unique Binary Search Trees II|[Go]({{< relref "/ChapterFour/0095.Unique-Binary-Search-Trees-II.md" >}})|Medium||||42.1%| +|0096|Unique Binary Search Trees|[Go]({{< relref "/ChapterFour/0096.Unique-Binary-Search-Trees.md" >}})|Medium| O(n^2)| O(n)||54.1%| +|0098|Validate Binary Search Tree|[Go]({{< relref "/ChapterFour/0098.Validate-Binary-Search-Tree.md" >}})|Medium| O(n)| O(1)||28.6%| +|0099|Recover Binary Search Tree|[Go]({{< relref "/ChapterFour/0099.Recover-Binary-Search-Tree.md" >}})|Hard| O(n)| O(1)||42.1%| +|0100|Same Tree|[Go]({{< relref "/ChapterFour/0100.Same-Tree.md" >}})|Easy| O(n)| O(1)||54.0%| +|0101|Symmetric Tree|[Go]({{< relref "/ChapterFour/0101.Symmetric-Tree.md" >}})|Easy| O(n)| O(1)||47.9%| +|0102|Binary Tree Level Order Traversal|[Go]({{< relref "/ChapterFour/0102.Binary-Tree-Level-Order-Traversal.md" >}})|Medium| O(n)| O(1)||56.2%| +|0103|Binary Tree Zigzag Level Order Traversal|[Go]({{< relref "/ChapterFour/0103.Binary-Tree-Zigzag-Level-Order-Traversal.md" >}})|Medium| O(n)| O(n)||49.8%| +|0104|Maximum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0104.Maximum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||67.7%| +|0105|Construct Binary Tree from Preorder and Inorder Traversal|[Go]({{< relref "/ChapterFour/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}})|Medium||||51.2%| +|0106|Construct Binary Tree from Inorder and Postorder Traversal|[Go]({{< relref "/ChapterFour/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}})|Medium||||49.1%| +|0107|Binary Tree Level Order Traversal II|[Go]({{< relref "/ChapterFour/0107.Binary-Tree-Level-Order-Traversal-II.md" >}})|Easy| O(n)| O(1)||54.8%| +|0108|Convert Sorted Array to Binary Search Tree|[Go]({{< relref "/ChapterFour/0108.Convert-Sorted-Array-to-Binary-Search-Tree.md" >}})|Easy| O(n)| O(1)||59.9%| +|0110|Balanced Binary Tree|[Go]({{< relref "/ChapterFour/0110.Balanced-Binary-Tree.md" >}})|Easy| O(n)| O(1)||44.6%| +|0111|Minimum Depth of Binary Tree|[Go]({{< relref "/ChapterFour/0111.Minimum-Depth-of-Binary-Tree.md" >}})|Easy| O(n)| O(1)||39.2%| +|0112|Path Sum|[Go]({{< relref "/ChapterFour/0112.Path-Sum.md" >}})|Easy| O(n)| O(1)||42.1%| +|0113|Path Sum II|[Go]({{< relref "/ChapterFour/0113.Path-Sum-II.md" >}})|Medium| O(n)| O(1)||48.6%| +|0114|Flatten Binary Tree to Linked List|[Go]({{< relref "/ChapterFour/0114.Flatten-Binary-Tree-to-Linked-List.md" >}})|Medium| O(n)| O(1)||51.4%| +|0124|Binary Tree Maximum Path Sum|[Go]({{< relref "/ChapterFour/0124.Binary-Tree-Maximum-Path-Sum.md" >}})|Hard| O(n)| O(1)||35.2%| +|0129|Sum Root to Leaf Numbers|[Go]({{< relref "/ChapterFour/0129.Sum-Root-to-Leaf-Numbers.md" >}})|Medium| O(n)| O(1)||50.6%| +|0144|Binary Tree Preorder Traversal|[Go]({{< relref "/ChapterFour/0144.Binary-Tree-Preorder-Traversal.md" >}})|Medium| O(n)| O(1)||57.1%| +|0145|Binary Tree Postorder Traversal|[Go]({{< relref "/ChapterFour/0145.Binary-Tree-Postorder-Traversal.md" >}})|Medium| O(n)| O(1)||57.1%| +|0173|Binary Search Tree Iterator|[Go]({{< relref "/ChapterFour/0173.Binary-Search-Tree-Iterator.md" >}})|Medium| O(n)| O(1)||59.6%| +|0199|Binary Tree Right Side View|[Go]({{< relref "/ChapterFour/0199.Binary-Tree-Right-Side-View.md" >}})|Medium| O(n)| O(1)||55.7%| +|0222|Count Complete Tree Nodes|[Go]({{< relref "/ChapterFour/0222.Count-Complete-Tree-Nodes.md" >}})|Medium| O(n)| O(1)||48.8%| +|0226|Invert Binary Tree|[Go]({{< relref "/ChapterFour/0226.Invert-Binary-Tree.md" >}})|Easy| O(n)| O(1)||66.6%| +|0230|Kth Smallest Element in a BST|[Go]({{< relref "/ChapterFour/0230.Kth-Smallest-Element-in-a-BST.md" >}})|Medium| O(n)| O(1)||62.1%| +|0235|Lowest Common Ancestor of a Binary Search Tree|[Go]({{< relref "/ChapterFour/0235.Lowest-Common-Ancestor-of-a-Binary-Search-Tree.md" >}})|Easy| O(n)| O(1)||51.4%| +|0236|Lowest Common Ancestor of a Binary Tree|[Go]({{< relref "/ChapterFour/0236.Lowest-Common-Ancestor-of-a-Binary-Tree.md" >}})|Medium| O(n)| O(1)||48.1%| +|0257|Binary Tree Paths|[Go]({{< relref "/ChapterFour/0257.Binary-Tree-Paths.md" >}})|Easy| O(n)| O(1)||53.2%| +|0337|House Robber III|[Go]({{< relref "/ChapterFour/0337.House-Robber-III.md" >}})|Medium||||51.7%| +|0404|Sum of Left Leaves|[Go]({{< relref "/ChapterFour/0404.Sum-of-Left-Leaves.md" >}})|Easy| O(n)| O(1)||52.2%| +|0437|Path Sum III|[Go]({{< relref "/ChapterFour/0437.Path-Sum-III.md" >}})|Medium| O(n)| O(1)||48.0%| +|0508|Most Frequent Subtree Sum|[Go]({{< relref "/ChapterFour/0508.Most-Frequent-Subtree-Sum.md" >}})|Medium||||58.9%| +|0513|Find Bottom Left Tree Value|[Go]({{< relref "/ChapterFour/0513.Find-Bottom-Left-Tree-Value.md" >}})|Medium||||62.3%| +|0515|Find Largest Value in Each Tree Row|[Go]({{< relref "/ChapterFour/0515.Find-Largest-Value-in-Each-Tree-Row.md" >}})|Medium| O(n)| O(n)||62.0%| +|0563|Binary Tree Tilt|[Go]({{< relref "/ChapterFour/0563.Binary-Tree-Tilt.md" >}})|Easy||||52.6%| +|0572|Subtree of Another Tree|[Go]({{< relref "/ChapterFour/0572.Subtree-of-Another-Tree.md" >}})|Easy||||44.4%| +|0637|Average of Levels in Binary Tree|[Go]({{< relref "/ChapterFour/0637.Average-of-Levels-in-Binary-Tree.md" >}})|Easy| O(n)| O(n)||64.5%| +|0653|Two Sum IV - Input is a BST|[Go]({{< relref "/ChapterFour/0653.Two-Sum-IV---Input-is-a-BST.md" >}})|Easy||||56.1%| +|0662|Maximum Width of Binary Tree|[Go]({{< relref "/ChapterFour/0662.Maximum-Width-of-Binary-Tree.md" >}})|Medium||||40.0%| +|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0684.Redundant-Connection.md" >}})|Medium||||58.7%| +|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0685.Redundant-Connection-II.md" >}})|Hard||||32.9%| +|0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||45.5%| +|0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||57.5%| +|0872|Leaf-Similar Trees|[Go]({{< relref "/ChapterFour/0872.Leaf-Similar-Trees.md" >}})|Easy||||64.5%| +|0897|Increasing Order Search Tree|[Go]({{< relref "/ChapterFour/0897.Increasing-Order-Search-Tree.md" >}})|Easy||||74.3%| +|0968|Binary Tree Cameras|[Go]({{< relref "/ChapterFour/0968.Binary-Tree-Cameras.md" >}})|Hard||||38.5%| +|0979|Distribute Coins in Binary Tree|[Go]({{< relref "/ChapterFour/0979.Distribute-Coins-in-Binary-Tree.md" >}})|Medium||||69.5%| +|0993|Cousins in Binary Tree|[Go]({{< relref "/ChapterFour/0993.Cousins-in-Binary-Tree.md" >}})|Easy| O(n)| O(1)||52.2%| +|1026|Maximum Difference Between Node and Ancestor|[Go]({{< relref "/ChapterFour/1026.Maximum-Difference-Between-Node-and-Ancestor.md" >}})|Medium||||69.1%| +|1028|Recover a Tree From Preorder Traversal|[Go]({{< relref "/ChapterFour/1028.Recover-a-Tree-From-Preorder-Traversal.md" >}})|Hard||||70.7%| +|1110|Delete Nodes And Return Forest|[Go]({{< relref "/ChapterFour/1110.Delete-Nodes-And-Return-Forest.md" >}})|Medium||||67.5%| +|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||67.8%| +|1145|Binary Tree Coloring Game|[Go]({{< relref "/ChapterFour/1145.Binary-Tree-Coloring-Game.md" >}})|Medium||||51.4%| +|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1302.Deepest-Leaves-Sum.md" >}})|Medium||||84.1%| +|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||77.8%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/ChapterTwo/Two_Pointers.md b/website/content/ChapterTwo/Two_Pointers.md index ece49e88..89c959a3 100644 --- a/website/content/ChapterTwo/Two_Pointers.md +++ b/website/content/ChapterTwo/Two_Pointers.md @@ -28,56 +28,63 @@ type: docs - 替换字母以后,相同字母能出现连续最长的长度。第 424 题。 - SUM 问题集。第 1 题,第 15 题,第 16 题,第 18 题,第 167 题,第 923 题,第 1074 题。 -| Title | Solution | Difficulty | Time | Space |收藏| -| ----- | :--------: | :----------: | :----: | :-----: | :-----: | -|3. Longest Substring Without Repeating Characters | [Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})| Medium | O(n)| O(1)|❤️| -|11. Container With Most Water | [Go]({{< relref "/ChapterFour/0011.Container-With-Most-Water.md" >}})| Medium | O(n)| O(1)|| -|15. 3Sum | [Go]({{< relref "/ChapterFour/0015.3Sum.md" >}})| Medium | O(n^2)| O(n)|❤️| -|16. 3Sum Closest | [Go]({{< relref "/ChapterFour/0016.3Sum-Closest.md" >}})| Medium | O(n^2)| O(1)|❤️| -|18. 4Sum | [Go]({{< relref "/ChapterFour/0018.4Sum.md" >}})| Medium | O(n^3)| O(n^2)|❤️| -|19. Remove Nth Node From End of List | [Go]({{< relref "/ChapterFour/0019.Remove-Nth-Node-From-End-of-List.md" >}})| Medium | O(n)| O(1)|| -|26. Remove Duplicates from Sorted Array | [Go]({{< relref "/ChapterFour/0026.Remove-Duplicates-from-Sorted-Array.md" >}})| Easy | O(n)| O(1)|| -|27. Remove Element | [Go]({{< relref "/ChapterFour/0027.Remove-Element.md" >}})| Easy | O(n)| O(1)|| -|28. Implement strStr() | [Go]({{< relref "/ChapterFour/0028.Implement-strStr.md" >}})| Easy | O(n)| O(1)|| -|30. Substring with Concatenation of All Words | [Go]({{< relref "/ChapterFour/0030.Substring-with-Concatenation-of-All-Words.md" >}})| Hard | O(n)| O(n)|❤️| -|42. Trapping Rain Water | [Go]({{< relref "/ChapterFour/0042.Trapping-Rain-Water.md" >}})| Hard | O(n)| O(1)|❤️| -|61. Rotate List | [Go]({{< relref "/ChapterFour/0061.Rotate-List.md" >}})| Medium | O(n)| O(1)|| -|75. Sort Colors | [Go]({{< relref "/ChapterFour/0075.Sort-Colors.md" >}})| Medium| O(n)| O(1)|❤️| -|76. Minimum Window Substring | [Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})| Hard | O(n)| O(n)|❤️| -|80. Remove Duplicates from Sorted Array II | [Go]({{< relref "/ChapterFour/0080.Remove-Duplicates-from-Sorted-Array-II.md" >}})| Medium | O(n)| O(1|| -|86. Partition List | [Go]({{< relref "/ChapterFour/0086.Partition-List.md" >}})| Medium | O(n)| O(1)|❤️| -|88. Merge Sorted Array | [Go]({{< relref "/ChapterFour/0088.Merge-Sorted-Array.md" >}})| Easy | O(n)| O(1)|❤️| -|125. Valid Palindrome | [Go]({{< relref "/ChapterFour/0125.Valid-Palindrome.md" >}})| Easy | O(n)| O(1)|| -|141. Linked List Cycle | [Go]({{< relref "/ChapterFour/0141.Linked-List-Cycle.md" >}})| Easy | O(n)| O(1)|❤️| -|142. Linked List Cycle II | [Go]({{< relref "/ChapterFour/0142.Linked-List-Cycle-II.md" >}})| Medium | O(n)| O(1)|❤️| -|167. Two Sum II - Input array is sorted | [Go]({{< relref "/ChapterFour/0167.Two-Sum-II---Input-array-is-sorted.md" >}})| Easy | O(n)| O(1)|| -|209. Minimum Size Subarray Sum | [Go]({{< relref "/ChapterFour/0209.Minimum-Size-Subarray-Sum.md" >}})| Medium | O(n)| O(1)|| -|234. Palindrome Linked List | [Go]({{< relref "/ChapterFour/0234.Palindrome-Linked-List.md" >}})| Easy | O(n)| O(1)|| -|283. Move Zeroes | [Go]({{< relref "/ChapterFour/0283.Move-Zeroes.md" >}})| Easy | O(n)| O(1)|| -|287. Find the Duplicate Number | [Go]({{< relref "/ChapterFour/0287.Find-the-Duplicate-Number.md" >}})| Easy | O(n)| O(1)|❤️| -|344. Reverse String | [Go]({{< relref "/ChapterFour/0344.Reverse-String.md" >}})| Easy | O(n)| O(1)|| -|345. Reverse Vowels of a String | [Go]({{< relref "/ChapterFour/0345.Reverse-Vowels-of-a-String.md" >}})| Easy | O(n)| O(1)|| -|349. Intersection of Two Arrays | [Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})| Easy | O(n)| O(n) || -|350. Intersection of Two Arrays II | [Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})| Easy | O(n)| O(n) || -|424. Longest Repeating Character Replacement | [Go]({{< relref "/ChapterFour/0424.Longest-Repeating-Character-Replacement.md" >}})| Medium | O(n)| O(1) || -|524. Longest Word in Dictionary through Deleting | [Go]({{< relref "/ChapterFour/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})| Medium | O(n)| O(1) || -|532. K-diff Pairs in an Array | [Go]({{< relref "/ChapterFour/0532.K-diff-Pairs-in-an-Array.md" >}})| Easy | O(n)| O(n)|| -|567. Permutation in String | [Go]({{< relref "/ChapterFour/0567.Permutation-in-String.md" >}})| Medium | O(n)| O(1)|❤️| -|713. Subarray Product Less Than K | [Go]({{< relref "/ChapterFour/0713.Subarray-Product-Less-Than-K.md" >}})| Medium | O(n)| O(1)|| -|763. Partition Labels | [Go]({{< relref "/ChapterFour/0763.Partition-Labels.md" >}})| Medium | O(n)| O(1)|❤️| -|826. Most Profit Assigning Work | [Go]({{< relref "/ChapterFour/0826.Most-Profit-Assigning-Work.md" >}})| Medium | O(n log n)| O(n)|| -|828. Unique Letter String | [Go]({{< relref "/ChapterFour/0828.COPYRIGHT-PROBLEM-XXX.md" >}})| Hard | O(n)| O(1)|❤️| -|838. Push Dominoes | [Go]({{< relref "/ChapterFour/0838.Push-Dominoes.md" >}})| Medium | O(n)| O(n)|| -|844. Backspace String Compare | [Go]({{< relref "/ChapterFour/0844.Backspace-String-Compare.md" >}})| Easy | O(n)| O(n) || -|845. Longest Mountain in Array | [Go]({{< relref "/ChapterFour/0845.Longest-Mountain-in-Array.md" >}})| Medium | O(n)| O(1) || -|881. Boats to Save People | [Go]({{< relref "/ChapterFour/0881.Boats-to-Save-People.md" >}})| Medium | O(n log n)| O(1) || -|904. Fruit Into Baskets | [Go]({{< relref "/ChapterFour/0904.Fruit-Into-Baskets.md" >}})| Medium | O(n log n)| O(1) || -|923. 3Sum With Multiplicity | [Go]({{< relref "/ChapterFour/0923.3Sum-With-Multiplicity.md" >}})| Medium | O(n^2)| O(n) || -|925. Long Pressed Name | [Go]({{< relref "/ChapterFour/0925.Long-Pressed-Name.md" >}})| Easy | O(n)| O(1)|| -|930. Binary Subarrays With Sum | [Go]({{< relref "/ChapterFour/0930.Binary-Subarrays-With-Sum.md" >}})| Medium | O(n)| O(n) |❤️| -|977. Squares of a Sorted Array | [Go]({{< relref "/ChapterFour/0977.Squares-of-a-Sorted-Array.md" >}})| Easy | O(n)| O(1)|| -|986. Interval List Intersections | [Go]({{< relref "/ChapterFour/0986.Interval-List-Intersections.md" >}})| Medium | O(n)| O(1)|| -|992. Subarrays with K Different Integers | [Go]({{< relref "/ChapterFour/0992.Subarrays-with-K-Different-Integers.md" >}})| Hard | O(n)| O(n)|❤️| -|1004. Max Consecutive Ones III | [Go]({{< relref "/ChapterFour/1004.Max-Consecutive-Ones-III.md" >}})| Medium | O(n)| O(1) || -|1093. Statistics from a Large Sample | [Go]({{< relref "/ChapterFour/1093.Statistics-from-a-Large-Sample.md" >}})| Medium | O(n)| O(1) || -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0003|Longest Substring Without Repeating Characters|[Go]({{< relref "/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters.md" >}})|Medium| O(n)| O(1)|❤️|31.3%| +|0011|Container With Most Water|[Go]({{< relref "/ChapterFour/0011.Container-With-Most-Water.md" >}})|Medium| O(n)| O(1)||52.2%| +|0015|3Sum|[Go]({{< relref "/ChapterFour/0015.3Sum.md" >}})|Medium| O(n^2)| O(n)|❤️|27.8%| +|0016|3Sum Closest|[Go]({{< relref "/ChapterFour/0016.3Sum-Closest.md" >}})|Medium| O(n^2)| O(1)|❤️|46.2%| +|0018|4Sum|[Go]({{< relref "/ChapterFour/0018.4Sum.md" >}})|Medium| O(n^3)| O(n^2)|❤️|34.6%| +|0019|Remove Nth Node From End of List|[Go]({{< relref "/ChapterFour/0019.Remove-Nth-Node-From-End-of-List.md" >}})|Medium| O(n)| O(1)||35.6%| +|0026|Remove Duplicates from Sorted Array|[Go]({{< relref "/ChapterFour/0026.Remove-Duplicates-from-Sorted-Array.md" >}})|Easy| O(n)| O(1)||46.3%| +|0027|Remove Element|[Go]({{< relref "/ChapterFour/0027.Remove-Element.md" >}})|Easy| O(n)| O(1)||49.0%| +|0028|Implement strStr()|[Go]({{< relref "/ChapterFour/0028.Implement-strStr.md" >}})|Easy| O(n)| O(1)||35.0%| +|0030|Substring with Concatenation of All Words|[Go]({{< relref "/ChapterFour/0030.Substring-with-Concatenation-of-All-Words.md" >}})|Hard| O(n)| O(n)|❤️|26.0%| +|0042|Trapping Rain Water|[Go]({{< relref "/ChapterFour/0042.Trapping-Rain-Water.md" >}})|Hard| O(n)| O(1)|❤️|50.7%| +|0061|Rotate List|[Go]({{< relref "/ChapterFour/0061.Rotate-List.md" >}})|Medium| O(n)| O(1)||31.6%| +|0075|Sort Colors|[Go]({{< relref "/ChapterFour/0075.Sort-Colors.md" >}})|Medium| O(n)| O(1)|❤️|48.9%| +|0076|Minimum Window Substring|[Go]({{< relref "/ChapterFour/0076.Minimum-Window-Substring.md" >}})|Hard| O(n)| O(n)|❤️|35.7%| +|0080|Remove Duplicates from Sorted Array II|[Go]({{< relref "/ChapterFour/0080.Remove-Duplicates-from-Sorted-Array-II.md" >}})|Medium| O(n)| O(1||45.8%| +|0086|Partition List|[Go]({{< relref "/ChapterFour/0086.Partition-List.md" >}})|Medium| O(n)| O(1)|❤️|43.0%| +|0088|Merge Sorted Array|[Go]({{< relref "/ChapterFour/0088.Merge-Sorted-Array.md" >}})|Easy| O(n)| O(1)|❤️|40.6%| +|0125|Valid Palindrome|[Go]({{< relref "/ChapterFour/0125.Valid-Palindrome.md" >}})|Easy| O(n)| O(1)||37.9%| +|0141|Linked List Cycle|[Go]({{< relref "/ChapterFour/0141.Linked-List-Cycle.md" >}})|Easy| O(n)| O(1)|❤️|42.2%| +|0142|Linked List Cycle II|[Go]({{< relref "/ChapterFour/0142.Linked-List-Cycle-II.md" >}})|Medium| O(n)| O(1)|❤️|39.3%| +|0167|Two Sum II - Input array is sorted|[Go]({{< relref "/ChapterFour/0167.Two-Sum-II---Input-array-is-sorted.md" >}})|Easy| O(n)| O(1)||55.4%| +|0209|Minimum Size Subarray Sum|[Go]({{< relref "/ChapterFour/0209.Minimum-Size-Subarray-Sum.md" >}})|Medium| O(n)| O(1)||39.2%| +|0234|Palindrome Linked List|[Go]({{< relref "/ChapterFour/0234.Palindrome-Linked-List.md" >}})|Easy| O(n)| O(1)||40.2%| +|0283|Move Zeroes|[Go]({{< relref "/ChapterFour/0283.Move-Zeroes.md" >}})|Easy| O(n)| O(1)||58.4%| +|0287|Find the Duplicate Number|[Go]({{< relref "/ChapterFour/0287.Find-the-Duplicate-Number.md" >}})|Medium| O(n)| O(1)|❤️|57.1%| +|0344|Reverse String|[Go]({{< relref "/ChapterFour/0344.Reverse-String.md" >}})|Easy| O(n)| O(1)||70.0%| +|0345|Reverse Vowels of a String|[Go]({{< relref "/ChapterFour/0345.Reverse-Vowels-of-a-String.md" >}})|Easy| O(n)| O(1)||44.9%| +|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||64.4%| +|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||51.9%| +|0424|Longest Repeating Character Replacement|[Go]({{< relref "/ChapterFour/0424.Longest-Repeating-Character-Replacement.md" >}})|Medium| O(n)| O(1) ||48.0%| +|0457|Circular Array Loop|[Go]({{< relref "/ChapterFour/0457.Circular-Array-Loop.md" >}})|Medium||||30.0%| +|0524|Longest Word in Dictionary through Deleting|[Go]({{< relref "/ChapterFour/0524.Longest-Word-in-Dictionary-through-Deleting.md" >}})|Medium| O(n)| O(1) ||48.9%| +|0532|K-diff Pairs in an Array|[Go]({{< relref "/ChapterFour/0532.K-diff-Pairs-in-an-Array.md" >}})|Medium| O(n)| O(n)||34.9%| +|0567|Permutation in String|[Go]({{< relref "/ChapterFour/0567.Permutation-in-String.md" >}})|Medium| O(n)| O(1)|❤️|44.6%| +|0632|Smallest Range Covering Elements from K Lists|[Go]({{< relref "/ChapterFour/0632.Smallest-Range-Covering-Elements-from-K-Lists.md" >}})|Hard||||53.9%| +|0713|Subarray Product Less Than K|[Go]({{< relref "/ChapterFour/0713.Subarray-Product-Less-Than-K.md" >}})|Medium| O(n)| O(1)||40.4%| +|0763|Partition Labels|[Go]({{< relref "/ChapterFour/0763.Partition-Labels.md" >}})|Medium| O(n)| O(1)|❤️|77.9%| +|0826|Most Profit Assigning Work|[Go]({{< relref "/ChapterFour/0826.Most-Profit-Assigning-Work.md" >}})|Medium| O(n log n)| O(n)||38.9%| +|0828|Count Unique Characters of All Substrings of a Given String|[Go]({{< relref "/ChapterFour/0828.Count-Unique-Characters-of-All-Substrings-of-a-Given-String.md" >}})|Hard| O(n)| O(1)|❤️|46.8%| +|0838|Push Dominoes|[Go]({{< relref "/ChapterFour/0838.Push-Dominoes.md" >}})|Medium| O(n)| O(n)||49.7%| +|0844|Backspace String Compare|[Go]({{< relref "/ChapterFour/0844.Backspace-String-Compare.md" >}})|Easy| O(n)| O(n) ||46.8%| +|0845|Longest Mountain in Array|[Go]({{< relref "/ChapterFour/0845.Longest-Mountain-in-Array.md" >}})|Medium| O(n)| O(1) ||38.5%| +|0881|Boats to Save People|[Go]({{< relref "/ChapterFour/0881.Boats-to-Save-People.md" >}})|Medium| O(n log n)| O(1) ||48.7%| +|0904|Fruit Into Baskets|[Go]({{< relref "/ChapterFour/0904.Fruit-Into-Baskets.md" >}})|Medium| O(n log n)| O(1) ||42.9%| +|0923|3Sum With Multiplicity|[Go]({{< relref "/ChapterFour/0923.3Sum-With-Multiplicity.md" >}})|Medium| O(n^2)| O(n) ||36.0%| +|0925|Long Pressed Name|[Go]({{< relref "/ChapterFour/0925.Long-Pressed-Name.md" >}})|Easy| O(n)| O(1)||38.4%| +|0930|Binary Subarrays With Sum|[Go]({{< relref "/ChapterFour/0930.Binary-Subarrays-With-Sum.md" >}})|Medium| O(n)| O(n) |❤️|44.3%| +|0977|Squares of a Sorted Array|[Go]({{< relref "/ChapterFour/0977.Squares-of-a-Sorted-Array.md" >}})|Easy| O(n)| O(1)||72.3%| +|0986|Interval List Intersections|[Go]({{< relref "/ChapterFour/0986.Interval-List-Intersections.md" >}})|Medium| O(n)| O(1)||68.1%| +|0992|Subarrays with K Different Integers|[Go]({{< relref "/ChapterFour/0992.Subarrays-with-K-Different-Integers.md" >}})|Hard| O(n)| O(n)|❤️|50.4%| +|1004|Max Consecutive Ones III|[Go]({{< relref "/ChapterFour/1004.Max-Consecutive-Ones-III.md" >}})|Medium| O(n)| O(1) ||60.5%| +|1093|Statistics from a Large Sample|[Go]({{< relref "/ChapterFour/1093.Statistics-from-a-Large-Sample.md" >}})|Medium| O(n)| O(1) ||49.3%| +|1234|Replace the Substring for Balanced String|[Go]({{< relref "/ChapterFour/1234.Replace-the-Substring-for-Balanced-String.md" >}})|Medium||||34.4%| +|1658|Minimum Operations to Reduce X to Zero|[Go]({{< relref "/ChapterFour/1658.Minimum-Operations-to-Reduce-X-to-Zero.md" >}})|Medium||||33.6%| +|1695|Maximum Erasure Value|[Go]({{< relref "/ChapterFour/1695.Maximum-Erasure-Value.md" >}})|Medium||||49.5%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| +| diff --git a/website/content/ChapterTwo/Union_Find.md b/website/content/ChapterTwo/Union_Find.md index 79b693d5..c72622df 100644 --- a/website/content/ChapterTwo/Union_Find.md +++ b/website/content/ChapterTwo/Union_Find.md @@ -15,24 +15,26 @@ type: docs - 能用并查集的题目,一般也可以用 DFS 和 BFS 解答,只不过时间复杂度会高一点。 -| Title | Solution | Difficulty | Time | Space | 收藏 | -| ----- | :--------: | :----------: | :----: | :-----: |:-----: | -|128. Longest Consecutive Sequence | [Go]({{< relref "/ChapterFour/0128.Longest-Consecutive-Sequence.md" >}})| Hard | O(n)| O(n)|❤️| -|130. Surrounded Regions | [Go]({{< relref "/ChapterFour/0130.Surrounded-Regions.md" >}})| Medium | O(m\*n)| O(m\*n)|| -|200. Number of Islands | [Go]({{< relref "/ChapterFour/0200.Number-of-Islands.md" >}})| Medium | O(m\*n)| O(m\*n)|| -|399. Evaluate Division | [Go]({{< relref "/ChapterFour/0399.Evaluate-Division.md" >}})| Medium | O(n)| O(n)|| -|547. Friend Circles | [Go]({{< relref "/ChapterFour/0547.Friend-Circles.md" >}})| Medium | O(n^2)| O(n)|| -|684. Redundant Connection | [Go]({{< relref "/ChapterFour/0684.Redundant-Connection.md" >}})| Medium | O(n)| O(n)|| -|685. Redundant Connection II | [Go]({{< relref "/ChapterFour/0685.Redundant-Connection-II.md" >}})| Hard | O(n)| O(n)|| -|721. Accounts Merge | [Go]({{< relref "/ChapterFour/0721.Accounts-Merge.md" >}})| Medium | O(n)| O(n)|❤️| -|765. Couples Holding Hands | [Go]({{< relref "/ChapterFour/0765.Couples-Holding-Hands.md" >}})| Hard | O(n)| O(n)|❤️| -|778. Swim in Rising Water | [Go]({{< relref "/ChapterFour/0778.Swim-in-Rising-Water.md" >}})| Hard | O(n^2)| O(n)|❤️| -|803. Bricks Falling When Hit | [Go]({{< relref "/ChapterFour/0803.Bricks-Falling-When-Hit.md" >}})| Hard | O(n^2)| O(n)|❤️| -|839. Similar String Groups | [Go]({{< relref "/ChapterFour/0839.Similar-String-Groups.md" >}})| Hard | O(n^2)| O(n)|| -|924. Minimize Malware Spread | [Go]({{< relref "/ChapterFour/0924.Minimize-Malware-Spread.md" >}})| Hard | O(m\*n)| O(n)|| -|928. Minimize Malware Spread II | [Go]({{< relref "/ChapterFour/0928.Minimize-Malware-Spread-II.md" >}})| Hard | O(m\*n)| O(n)|❤️| -|947. Most Stones Removed with Same Row or Column | [Go]({{< relref "/ChapterFour/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}})| Medium | O(n)| O(n)|| -|952. Largest Component Size by Common Factor | [Go]({{< relref "/ChapterFour/0952.Largest-Component-Size-by-Common-Factor.md" >}})| Hard | O(n)| O(n)|❤️| -|959. Regions Cut By Slashes | [Go]({{< relref "/ChapterFour/0959.Regions-Cut-By-Slashes.md" >}})| Medium | O(n^2)| O(n^2)|❤️| -|990. Satisfiability of Equality Equations | [Go]({{< relref "/ChapterFour/0990.Satisfiability-of-Equality-Equations.md" >}})| Medium | O(n)| O(n)|| -|---------------------------------------|---------------------------------|--------------------------|-----------------------|-----------|--------| \ No newline at end of file + +| No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | +|:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | +|0128|Longest Consecutive Sequence|[Go]({{< relref "/ChapterFour/0128.Longest-Consecutive-Sequence.md" >}})|Hard| O(n)| O(n)|❤️|46.0%| +|0130|Surrounded Regions|[Go]({{< relref "/ChapterFour/0130.Surrounded-Regions.md" >}})|Medium| O(m\*n)| O(m\*n)||29.2%| +|0200|Number of Islands|[Go]({{< relref "/ChapterFour/0200.Number-of-Islands.md" >}})|Medium| O(m\*n)| O(m\*n)||48.6%| +|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0399.Evaluate-Division.md" >}})|Medium| O(n)| O(n)||54.0%| +|0547|Number of Provinces|[Go]({{< relref "/ChapterFour/0547.Number-of-Provinces.md" >}})|Medium| O(n^2)| O(n)||60.1%| +|0684|Redundant Connection|[Go]({{< relref "/ChapterFour/0684.Redundant-Connection.md" >}})|Medium| O(n)| O(n)||58.7%| +|0685|Redundant Connection II|[Go]({{< relref "/ChapterFour/0685.Redundant-Connection-II.md" >}})|Hard| O(n)| O(n)||32.9%| +|0721|Accounts Merge|[Go]({{< relref "/ChapterFour/0721.Accounts-Merge.md" >}})|Medium| O(n)| O(n)|❤️|51.2%| +|0765|Couples Holding Hands|[Go]({{< relref "/ChapterFour/0765.Couples-Holding-Hands.md" >}})|Hard| O(n)| O(n)|❤️|55.3%| +|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0778.Swim-in-Rising-Water.md" >}})|Hard| O(n^2)| O(n)|❤️|54.4%| +|0803|Bricks Falling When Hit|[Go]({{< relref "/ChapterFour/0803.Bricks-Falling-When-Hit.md" >}})|Hard| O(n^2)| O(n)|❤️|31.2%| +|0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0839.Similar-String-Groups.md" >}})|Hard| O(n^2)| O(n)||40.0%| +|0924|Minimize Malware Spread|[Go]({{< relref "/ChapterFour/0924.Minimize-Malware-Spread.md" >}})|Hard| O(m\*n)| O(n)||41.8%| +|0928|Minimize Malware Spread II|[Go]({{< relref "/ChapterFour/0928.Minimize-Malware-Spread-II.md" >}})|Hard| O(m\*n)| O(n)|❤️|41.2%| +|0947|Most Stones Removed with Same Row or Column|[Go]({{< relref "/ChapterFour/0947.Most-Stones-Removed-with-Same-Row-or-Column.md" >}})|Medium| O(n)| O(n)||55.4%| +|0952|Largest Component Size by Common Factor|[Go]({{< relref "/ChapterFour/0952.Largest-Component-Size-by-Common-Factor.md" >}})|Hard| O(n)| O(n)|❤️|36.1%| +|0959|Regions Cut By Slashes|[Go]({{< relref "/ChapterFour/0959.Regions-Cut-By-Slashes.md" >}})|Medium| O(n^2)| O(n^2)|❤️|66.8%| +|0990|Satisfiability of Equality Equations|[Go]({{< relref "/ChapterFour/0990.Satisfiability-of-Equality-Equations.md" >}})|Medium| O(n)| O(n)||46.4%| +|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1202.Smallest-String-With-Swaps.md" >}})|Medium||||48.3%| +|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------| diff --git a/website/content/menu/index.md b/website/content/menu/index.md index de7f9a68..60a9f27c 100644 --- a/website/content/menu/index.md +++ b/website/content/menu/index.md @@ -184,7 +184,7 @@ headless: true - [0208.Implement-Trie-Prefix-Tree]({{< relref "/ChapterFour/0208.Implement-Trie-Prefix-Tree.md" >}}) - [0209.Minimum-Size-Subarray-Sum]({{< relref "/ChapterFour/0209.Minimum-Size-Subarray-Sum.md" >}}) - [0210.Course-Schedule-II]({{< relref "/ChapterFour/0210.Course-Schedule-II.md" >}}) - - [0211.Add-and-Search-Word---Data-structure-design]({{< relref "/ChapterFour/0211.Add-and-Search-Word---Data-structure-design.md" >}}) + - [0211.Design-Add-and-Search-Words-Data-Structure]({{< relref "/ChapterFour/0211.Design-Add-and-Search-Words-Data-Structure.md" >}}) - [0212.Word-Search-II]({{< relref "/ChapterFour/0212.Word-Search-II.md" >}}) - [0213.House-Robber-II]({{< relref "/ChapterFour/0213.House-Robber-II.md" >}}) - [0215.Kth-Largest-Element-in-an-Array]({{< relref "/ChapterFour/0215.Kth-Largest-Element-in-an-Array.md" >}})