From c29b144c00392044d09d965fc63cf7dfd1eaa6b5 Mon Sep 17 00:00:00 2001
From: Libin YANG
Date: Fri, 17 May 2024 11:32:10 +0800
Subject: [PATCH] feat: update code blocks (#2827)
---
basic/sorting/BubbleSort/README.md | 14 ++++++
basic/sorting/HeapSort/README.md | 16 +++++++
basic/sorting/InsertionSort/README.md | 14 ++++++
basic/sorting/MergeSort/README.md | 12 +++++
basic/sorting/QuickSort/README.md | 12 +++++
basic/sorting/SelectionSort/README.md | 14 ++++++
basic/sorting/ShellSort/README.md | 8 ++++
lcci/01.01.Is Unique/README.md | 14 ++++++
lcci/01.01.Is Unique/README_EN.md | 14 ++++++
lcci/01.02.Check Permutation/README.md | 28 ++++++++++++
lcci/01.02.Check Permutation/README_EN.md | 28 ++++++++++++
lcci/01.03.String to URL/README.md | 18 ++++++++
lcci/01.03.String to URL/README_EN.md | 18 ++++++++
lcci/01.04.Palindrome Permutation/README.md | 20 +++++++++
.../01.04.Palindrome Permutation/README_EN.md | 20 +++++++++
lcci/01.05.One Away/README.md | 14 ++++++
lcci/01.05.One Away/README_EN.md | 14 ++++++
lcci/01.06.Compress String/README.md | 16 +++++++
lcci/01.06.Compress String/README_EN.md | 16 +++++++
lcci/01.07.Rotate Matrix/README.md | 18 ++++++++
lcci/01.07.Rotate Matrix/README_EN.md | 18 ++++++++
lcci/01.08.Zero Matrix/README.md | 34 ++++++++++++++
lcci/01.08.Zero Matrix/README_EN.md | 34 ++++++++++++++
lcci/01.09.String Rotation/README.md | 14 ++++++
lcci/01.09.String Rotation/README_EN.md | 14 ++++++
lcci/02.01.Remove Duplicate Node/README.md | 16 +++++++
lcci/02.01.Remove Duplicate Node/README_EN.md | 16 +++++++
.../02.02.Kth Node From End of List/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
lcci/02.03.Delete Middle Node/README.md | 12 +++++
lcci/02.03.Delete Middle Node/README_EN.md | 12 +++++
lcci/02.04.Partition List/README.md | 12 +++++
lcci/02.04.Partition List/README_EN.md | 12 +++++
lcci/02.05.Sum Lists/README.md | 16 +++++++
lcci/02.05.Sum Lists/README_EN.md | 16 +++++++
lcci/02.06.Palindrome Linked List/README.md | 16 +++++++
.../02.06.Palindrome Linked List/README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
lcci/02.08.Linked List Cycle/README_EN.md | 14 ++++++
lcci/03.01.Three in One/README.md | 12 +++++
lcci/03.01.Three in One/README_EN.md | 12 +++++
lcci/03.02.Min Stack/README.md | 16 +++++++
lcci/03.02.Min Stack/README_EN.md | 16 +++++++
lcci/03.03.Stack of Plates/README.md | 12 +++++
lcci/03.03.Stack of Plates/README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
lcci/03.05.Sort of Stacks/README.md | 14 ++++++
lcci/03.05.Sort of Stacks/README_EN.md | 14 ++++++
lcci/03.06.Animal Shelter/README.md | 14 ++++++
lcci/03.06.Animal Shelter/README_EN.md | 14 ++++++
lcci/04.01.Route Between Nodes/README.md | 22 ++++++++++
lcci/04.01.Route Between Nodes/README_EN.md | 22 ++++++++++
lcci/04.02.Minimum Height Tree/README.md | 16 +++++++
lcci/04.02.Minimum Height Tree/README_EN.md | 16 +++++++
lcci/04.03.List of Depth/README.md | 14 ++++++
lcci/04.03.List of Depth/README_EN.md | 14 ++++++
lcci/04.04.Check Balance/README.md | 12 +++++
lcci/04.04.Check Balance/README_EN.md | 12 +++++
lcci/04.05.Legal Binary Search Tree/README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
lcci/04.06.Successor/README.md | 14 ++++++
lcci/04.06.Successor/README_EN.md | 14 ++++++
lcci/04.08.First Common Ancestor/README.md | 6 +++
lcci/04.08.First Common Ancestor/README_EN.md | 6 +++
lcci/04.09.BST Sequences/README.md | 2 +
lcci/04.09.BST Sequences/README_EN.md | 2 +
lcci/04.10.Check SubTree/README.md | 14 ++++++
lcci/04.10.Check SubTree/README_EN.md | 14 ++++++
lcci/04.12.Paths with Sum/README.md | 14 ++++++
lcci/04.12.Paths with Sum/README_EN.md | 14 ++++++
lcci/05.01.Insert Into Bits/README.md | 12 +++++
lcci/05.01.Insert Into Bits/README_EN.md | 12 +++++
lcci/05.02.Binary Number to String/README.md | 10 +++++
.../README_EN.md | 10 +++++
lcci/05.03.Reverse Bits/README.md | 12 +++++
lcci/05.03.Reverse Bits/README_EN.md | 12 +++++
lcci/05.04.Closed Number/README.md | 12 +++++
lcci/05.04.Closed Number/README_EN.md | 12 +++++
lcci/05.06.Convert Integer/README.md | 14 ++++++
lcci/05.06.Convert Integer/README_EN.md | 14 ++++++
lcci/05.07.Exchange/README.md | 14 ++++++
lcci/05.07.Exchange/README_EN.md | 14 ++++++
lcci/05.08.Draw Line/README.md | 6 +++
lcci/05.08.Draw Line/README_EN.md | 6 +++
lcci/08.01.Three Steps Problem/README.md | 28 ++++++++++++
lcci/08.01.Three Steps Problem/README_EN.md | 28 ++++++++++++
lcci/08.02.Robot in a Grid/README.md | 14 ++++++
lcci/08.02.Robot in a Grid/README_EN.md | 14 ++++++
lcci/08.03.Magic Index/README.md | 16 +++++++
lcci/08.03.Magic Index/README_EN.md | 16 +++++++
lcci/08.04.Power Set/README.md | 28 ++++++++++++
lcci/08.04.Power Set/README_EN.md | 28 ++++++++++++
lcci/08.05.Recursive Mulitply/README.md | 14 ++++++
lcci/08.05.Recursive Mulitply/README_EN.md | 14 ++++++
lcci/08.06.Hanota/README.md | 22 ++++++++++
lcci/08.06.Hanota/README_EN.md | 22 ++++++++++
lcci/08.07.Permutation I/README.md | 14 ++++++
lcci/08.07.Permutation I/README_EN.md | 14 ++++++
lcci/08.08.Permutation II/README.md | 14 ++++++
lcci/08.08.Permutation II/README_EN.md | 14 ++++++
lcci/08.09.Bracket/README.md | 16 +++++++
lcci/08.09.Bracket/README_EN.md | 16 +++++++
lcci/08.10.Color Fill/README.md | 24 ++++++++++
lcci/08.10.Color Fill/README_EN.md | 24 ++++++++++
lcci/08.11.Coin/README.md | 22 ++++++++++
lcci/08.11.Coin/README_EN.md | 22 ++++++++++
lcci/08.12.Eight Queens/README.md | 14 ++++++
lcci/08.12.Eight Queens/README_EN.md | 14 ++++++
lcci/08.13.Pile Box/README.md | 12 +++++
lcci/08.13.Pile Box/README_EN.md | 12 +++++
lcci/08.14.Boolean Evaluation/README.md | 10 +++++
lcci/08.14.Boolean Evaluation/README_EN.md | 10 +++++
lcci/10.01.Sorted Merge/README.md | 16 +++++++
lcci/10.01.Sorted Merge/README_EN.md | 16 +++++++
lcci/10.02.Group Anagrams/README.md | 20 +++++++++
lcci/10.02.Group Anagrams/README_EN.md | 20 +++++++++
lcci/10.03.Search Rotate Array/README.md | 12 +++++
lcci/10.03.Search Rotate Array/README_EN.md | 12 +++++
lcci/10.05.Sparse Array Search/README.md | 12 +++++
lcci/10.05.Sparse Array Search/README_EN.md | 12 +++++
lcci/10.09.Sorted Matrix Search/README.md | 30 +++++++++++++
lcci/10.09.Sorted Matrix Search/README_EN.md | 30 +++++++++++++
lcci/10.10.Rank from Stream/README.md | 12 +++++
lcci/10.10.Rank from Stream/README_EN.md | 12 +++++
lcci/10.11.Peaks and Valleys/README.md | 12 +++++
lcci/10.11.Peaks and Valleys/README_EN.md | 12 +++++
lcci/16.01.Swap Numbers/README.md | 12 +++++
lcci/16.01.Swap Numbers/README_EN.md | 12 +++++
lcci/16.02.Words Frequency/README.md | 16 +++++++
lcci/16.02.Words Frequency/README_EN.md | 16 +++++++
lcci/16.04.Tic-Tac-Toe/README.md | 12 +++++
lcci/16.04.Tic-Tac-Toe/README_EN.md | 12 +++++
lcci/16.05.Factorial Zeros/README.md | 12 +++++
lcci/16.05.Factorial Zeros/README_EN.md | 12 +++++
lcci/16.06.Smallest Difference/README.md | 22 ++++++++++
lcci/16.06.Smallest Difference/README_EN.md | 22 ++++++++++
lcci/16.07.Maximum/README.md | 12 +++++
lcci/16.07.Maximum/README_EN.md | 12 +++++
lcci/16.10.Living People/README.md | 14 ++++++
lcci/16.10.Living People/README_EN.md | 14 ++++++
lcci/16.11.Diving Board/README.md | 12 +++++
lcci/16.11.Diving Board/README_EN.md | 12 +++++
lcci/16.13.Bisect Squares/README.md | 12 +++++
lcci/16.13.Bisect Squares/README_EN.md | 12 +++++
lcci/16.14.Best Line/README.md | 18 ++++++++
lcci/16.14.Best Line/README_EN.md | 18 ++++++++
lcci/16.15.Master Mind/README.md | 12 +++++
lcci/16.15.Master Mind/README_EN.md | 12 +++++
lcci/16.16.Sub Sort/README.md | 12 +++++
lcci/16.16.Sub Sort/README_EN.md | 12 +++++
lcci/16.17.Contiguous Sequence/README.md | 14 ++++++
lcci/16.17.Contiguous Sequence/README_EN.md | 14 ++++++
lcci/16.18.Pattern Matching/README.md | 12 +++++
lcci/16.18.Pattern Matching/README_EN.md | 12 +++++
lcci/16.19.Pond Sizes/README.md | 12 +++++
lcci/16.19.Pond Sizes/README_EN.md | 12 +++++
lcci/16.20.T9/README.md | 14 ++++++
lcci/16.20.T9/README_EN.md | 14 ++++++
lcci/16.21.Sum Swap/README.md | 12 +++++
lcci/16.21.Sum Swap/README_EN.md | 12 +++++
lcci/16.22.Langtons Ant/README.md | 10 +++++
lcci/16.22.Langtons Ant/README_EN.md | 10 +++++
lcci/16.24.Pairs With Sum/README.md | 12 +++++
lcci/16.24.Pairs With Sum/README_EN.md | 12 +++++
lcci/16.25.LRU Cache/README.md | 16 +++++++
lcci/16.25.LRU Cache/README_EN.md | 16 +++++++
lcci/16.26.Calculator/README.md | 12 +++++
lcci/16.26.Calculator/README_EN.md | 12 +++++
lcci/17.01.Add Without Plus/README.md | 4 ++
lcci/17.01.Add Without Plus/README_EN.md | 4 ++
lcci/17.04.Missing Number/README.md | 40 +++++++++++++++++
lcci/17.04.Missing Number/README_EN.md | 40 +++++++++++++++++
lcci/17.05.Find Longest Subarray/README.md | 12 +++++
lcci/17.05.Find Longest Subarray/README_EN.md | 12 +++++
lcci/17.06.Number Of 2s In Range/README.md | 10 +++++
lcci/17.06.Number Of 2s In Range/README_EN.md | 10 +++++
lcci/17.07.Baby Names/README.md | 12 +++++
lcci/17.07.Baby Names/README_EN.md | 12 +++++
lcci/17.08.Circus Tower/README.md | 10 +++++
lcci/17.08.Circus Tower/README_EN.md | 10 +++++
lcci/17.09.Get Kth Magic Number/README.md | 24 ++++++++++
lcci/17.09.Get Kth Magic Number/README_EN.md | 24 ++++++++++
lcci/17.10.Find Majority Element/README.md | 14 ++++++
lcci/17.10.Find Majority Element/README_EN.md | 14 ++++++
lcci/17.11.Find Closest/README.md | 24 ++++++++++
lcci/17.11.Find Closest/README_EN.md | 24 ++++++++++
lcci/17.12.BiNode/README.md | 10 +++++
lcci/17.12.BiNode/README_EN.md | 10 +++++
lcci/17.13.Re-Space/README.md | 10 +++++
lcci/17.13.Re-Space/README_EN.md | 10 +++++
lcci/17.14.Smallest K/README.md | 18 ++++++++
lcci/17.14.Smallest K/README_EN.md | 18 ++++++++
lcci/17.15.Longest Word/README.md | 8 ++++
lcci/17.15.Longest Word/README_EN.md | 8 ++++
lcci/17.16.The Masseuse/README.md | 12 +++++
lcci/17.16.The Masseuse/README_EN.md | 12 +++++
lcci/17.17.Multi Search/README.md | 10 +++++
lcci/17.17.Multi Search/README_EN.md | 10 +++++
lcci/17.18.Shortest Supersequence/README.md | 12 +++++
.../17.18.Shortest Supersequence/README_EN.md | 12 +++++
lcci/17.19.Missing Two/README.md | 10 +++++
lcci/17.19.Missing Two/README_EN.md | 10 +++++
lcci/17.20.Continuous Median/README.md | 10 +++++
lcci/17.20.Continuous Median/README_EN.md | 10 +++++
lcci/17.21.Volume of Histogram/README.md | 14 ++++++
lcci/17.21.Volume of Histogram/README_EN.md | 14 ++++++
lcci/17.22.Word Transformer/README.md | 12 +++++
lcci/17.22.Word Transformer/README_EN.md | 12 +++++
lcci/17.23.Max Black Square/README.md | 12 +++++
lcci/17.23.Max Black Square/README_EN.md | 12 +++++
lcci/17.24.Max Submatrix/README.md | 10 +++++
lcci/17.24.Max Submatrix/README_EN.md | 10 +++++
lcci/17.25.Word Rectangle/README.md | 10 +++++
lcci/17.25.Word Rectangle/README_EN.md | 10 +++++
lcci/17.26.Sparse Similarity/README.md | 8 ++++
lcci/17.26.Sparse Similarity/README_EN.md | 8 ++++
.../README.md" | 34 ++++++++++++++
.../README.md" | 24 ++++++++++
.../README.md" | 34 ++++++++++++++
.../README.md" | 28 ++++++++++++
.../README.md" | 18 ++++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 28 ++++++++++++
.../README.md" | 16 +++++++
.../README.md" | 26 +++++++++++
.../README.md" | 24 ++++++++++
.../README.md" | 14 ++++++
.../README.md" | 22 ++++++++++
.../README.md" | 16 +++++++
.../README.md" | 12 +++++
.../README.md" | 14 ++++++
.../README.md" | 24 ++++++++++
.../README.md" | 10 +++++
.../README.md" | 16 +++++++
.../README.md" | 14 ++++++
.../README.md" | 30 +++++++++++++
.../README.md" | 32 ++++++++++++++
.../README.md" | 16 +++++++
.../README.md" | 18 ++++++++
.../README.md" | 16 +++++++
.../README.md" | 24 ++++++++++
.../README.md" | 30 +++++++++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 28 ++++++++++++
.../README.md" | 18 ++++++++
.../README.md" | 24 ++++++++++
.../README.md" | 12 +++++
.../README.md" | 18 ++++++++
.../README.md" | 16 +++++++
.../README.md" | 14 ++++++
.../README.md" | 32 ++++++++++++++
.../README.md" | 18 ++++++++
.../README.md" | 16 +++++++
.../README.md" | 12 +++++
.../README.md" | 20 +++++++++
.../README.md" | 16 +++++++
.../README.md" | 30 +++++++++++++
.../README.md" | 28 ++++++++++++
.../README.md" | 28 ++++++++++++
.../README.md" | 22 ++++++++++
.../README.md" | 16 +++++++
.../README.md" | 22 ++++++++++
.../README.md" | 14 ++++++
.../README.md" | 14 ++++++
.../README.md" | 16 +++++++
.../README.md" | 18 ++++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 14 ++++++
.../README.md" | 14 ++++++
.../README.md" | 12 +++++
.../README.md" | 32 ++++++++++++++
.../README.md" | 24 ++++++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 20 +++++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 16 +++++++
.../README.md" | 14 ++++++
.../README.md" | 10 +++++
.../README.md" | 24 ++++++++++
.../README.md" | 14 ++++++
.../README.md" | 12 +++++
.../README.md" | 18 ++++++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 24 ++++++++++
.../README.md" | 18 ++++++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 14 ++++++
.../README.md" | 10 +++++
.../README.md" | 20 +++++++++
.../README.md" | 20 +++++++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 14 ++++++
.../README.md" | 14 ++++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 14 ++++++
.../README.md" | 6 +++
.../README.md" | 10 +++++
.../README.md" | 6 +++
.../README.md" | 14 ++++++
.../README.md" | 10 +++++
.../README.md" | 18 ++++++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 12 +++++
.../README.md" | 24 ++++++++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 16 +++++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 10 +++++
.../README.md" | 16 +++++++
.../README.md" | 22 ++++++++++
.../README.md" | 10 +++++
.../README.md" | 22 ++++++++++
.../README.md" | 20 +++++++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 6 +++
.../README.md" | 8 ++++
.../README.md" | 18 ++++++++
.../README.md" | 8 ++++
.../README.md" | 12 +++++
.../README.md" | 16 +++++++
.../README.md" | 8 ++++
.../README.md" | 16 +++++++
.../README.md" | 8 ++++
.../README.md" | 12 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 12 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 14 ++++++
.../README.md" | 14 ++++++
.../README.md" | 12 +++++
.../README.md" | 8 ++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 12 +++++
.../README.md" | 10 +++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 20 +++++++++
.../README.md" | 22 ++++++++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 12 +++++
.../README.md" | 18 ++++++++
.../README.md" | 36 +++++++++++++++
.../README.md" | 20 +++++++++
.../README.md" | 38 ++++++++++++++++
.../README.md" | 12 +++++
.../README.md" | 10 +++++
.../README.md" | 12 +++++
.../README.md" | 18 ++++++++
.../README.md" | 14 ++++++
.../README.md" | 8 ++++
.../README.md" | 12 +++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 6 +++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 12 +++++
.../README.md" | 6 +++
.../README.md" | 10 +++++
.../README.md" | 16 +++++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 24 ++++++++++
.../README.md" | 16 +++++++
.../README.md" | 12 +++++
.../README.md" | 10 +++++
"lcp/LCP 05. \345\217\221 LeetCoin/README.md" | 6 +++
.../README.md" | 16 +++++++
.../README.md" | 20 +++++++++
.../README.md" | 4 ++
.../README.md" | 8 ++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 10 +++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 8 ++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 10 +++++
.../README.md" | 12 +++++
.../README.md" | 12 +++++
.../README.md" | 10 +++++
solution/0000-0099/0001.Two Sum/README.md | 26 +++++++++++
solution/0000-0099/0001.Two Sum/README_EN.md | 26 +++++++++++
.../0000-0099/0002.Add Two Numbers/README.md | 24 ++++++++++
.../0002.Add Two Numbers/README_EN.md | 24 ++++++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../0006.Zigzag Conversion/README.md | 32 ++++++++++++++
.../0006.Zigzag Conversion/README_EN.md | 32 ++++++++++++++
.../0000-0099/0007.Reverse Integer/README.md | 18 ++++++++
.../0007.Reverse Integer/README_EN.md | 18 ++++++++
.../0008.String to Integer (atoi)/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0009.Palindrome Number/README.md | 18 ++++++++
.../0009.Palindrome Number/README_EN.md | 18 ++++++++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../0011.Container With Most Water/README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../0000-0099/0012.Integer to Roman/README.md | 14 ++++++
.../0012.Integer to Roman/README_EN.md | 14 ++++++
.../0000-0099/0013.Roman to Integer/README.md | 18 ++++++++
.../0013.Roman to Integer/README_EN.md | 18 ++++++++
.../0014.Longest Common Prefix/README.md | 20 +++++++++
.../0014.Longest Common Prefix/README_EN.md | 20 +++++++++
solution/0000-0099/0015.3Sum/README.md | 20 +++++++++
solution/0000-0099/0015.3Sum/README_EN.md | 20 +++++++++
.../0000-0099/0016.3Sum Closest/README.md | 14 ++++++
.../0000-0099/0016.3Sum Closest/README_EN.md | 14 ++++++
.../README.md | 34 ++++++++++++++
.../README_EN.md | 34 ++++++++++++++
solution/0000-0099/0018.4Sum/README.md | 16 +++++++
solution/0000-0099/0018.4Sum/README_EN.md | 16 +++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../0020.Valid Parentheses/README.md | 20 +++++++++
.../0020.Valid Parentheses/README_EN.md | 20 +++++++++
.../0021.Merge Two Sorted Lists/README.md | 34 ++++++++++++++
.../0021.Merge Two Sorted Lists/README_EN.md | 34 ++++++++++++++
.../0022.Generate Parentheses/README.md | 18 ++++++++
.../0022.Generate Parentheses/README_EN.md | 18 ++++++++
.../0023.Merge k Sorted Lists/README.md | 18 ++++++++
.../0023.Merge k Sorted Lists/README_EN.md | 18 ++++++++
.../0024.Swap Nodes in Pairs/README.md | 30 +++++++++++++
.../0024.Swap Nodes in Pairs/README_EN.md | 30 +++++++++++++
.../0025.Reverse Nodes in k-Group/README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0000-0099/0027.Remove Element/README.md | 16 +++++++
.../0027.Remove Element/README_EN.md | 16 +++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../0029.Divide Two Integers/README.md | 14 ++++++
.../0029.Divide Two Integers/README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0000-0099/0031.Next Permutation/README.md | 16 +++++++
.../0031.Next Permutation/README_EN.md | 16 +++++++
.../0032.Longest Valid Parentheses/README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0035.Search Insert Position/README.md | 22 ++++++++++
.../0035.Search Insert Position/README_EN.md | 22 ++++++++++
.../0000-0099/0036.Valid Sudoku/README.md | 14 ++++++
.../0000-0099/0036.Valid Sudoku/README_EN.md | 14 ++++++
.../0000-0099/0037.Sudoku Solver/README.md | 12 +++++
.../0000-0099/0037.Sudoku Solver/README_EN.md | 12 +++++
.../0000-0099/0038.Count and Say/README.md | 18 ++++++++
.../0000-0099/0038.Count and Say/README_EN.md | 18 ++++++++
.../0000-0099/0039.Combination Sum/README.md | 30 +++++++++++++
.../0039.Combination Sum/README_EN.md | 30 +++++++++++++
.../0040.Combination Sum II/README.md | 34 ++++++++++++++
.../0040.Combination Sum II/README_EN.md | 34 ++++++++++++++
.../0041.First Missing Positive/README.md | 18 ++++++++
.../0041.First Missing Positive/README_EN.md | 18 ++++++++
.../0042.Trapping Rain Water/README.md | 16 +++++++
.../0042.Trapping Rain Water/README_EN.md | 16 +++++++
.../0000-0099/0043.Multiply Strings/README.md | 16 +++++++
.../0043.Multiply Strings/README_EN.md | 16 +++++++
.../0044.Wildcard Matching/README.md | 24 ++++++++++
.../0044.Wildcard Matching/README_EN.md | 24 ++++++++++
.../0000-0099/0045.Jump Game II/README.md | 18 ++++++++
.../0000-0099/0045.Jump Game II/README_EN.md | 18 ++++++++
.../0000-0099/0046.Permutations/README.md | 18 ++++++++
.../0000-0099/0046.Permutations/README_EN.md | 18 ++++++++
.../0000-0099/0047.Permutations II/README.md | 14 ++++++
.../0047.Permutations II/README_EN.md | 14 ++++++
.../0000-0099/0048.Rotate Image/README.md | 16 +++++++
.../0000-0099/0048.Rotate Image/README_EN.md | 16 +++++++
.../0000-0099/0049.Group Anagrams/README.md | 24 ++++++++++
.../0049.Group Anagrams/README_EN.md | 24 ++++++++++
solution/0000-0099/0050.Pow(x, n)/README.md | 16 +++++++
.../0000-0099/0050.Pow(x, n)/README_EN.md | 16 +++++++
solution/0000-0099/0051.N-Queens/README.md | 12 +++++
solution/0000-0099/0051.N-Queens/README_EN.md | 12 +++++
solution/0000-0099/0052.N-Queens II/README.md | 12 +++++
.../0000-0099/0052.N-Queens II/README_EN.md | 12 +++++
.../0000-0099/0053.Maximum Subarray/README.md | 20 +++++++++
.../0053.Maximum Subarray/README_EN.md | 20 +++++++++
.../0000-0099/0054.Spiral Matrix/README.md | 44 +++++++++++++++++++
.../0000-0099/0054.Spiral Matrix/README_EN.md | 44 +++++++++++++++++++
solution/0000-0099/0055.Jump Game/README.md | 16 +++++++
.../0000-0099/0055.Jump Game/README_EN.md | 16 +++++++
.../0000-0099/0056.Merge Intervals/README.md | 28 ++++++++++++
.../0056.Merge Intervals/README_EN.md | 28 ++++++++++++
.../0000-0099/0057.Insert Interval/README.md | 28 ++++++++++++
.../0057.Insert Interval/README_EN.md | 28 ++++++++++++
.../0058.Length of Last Word/README.md | 18 ++++++++
.../0058.Length of Last Word/README_EN.md | 18 ++++++++
.../0000-0099/0059.Spiral Matrix II/README.md | 16 +++++++
.../0059.Spiral Matrix II/README_EN.md | 16 +++++++
.../0060.Permutation Sequence/README.md | 14 ++++++
.../0060.Permutation Sequence/README_EN.md | 14 ++++++
solution/0000-0099/0061.Rotate List/README.md | 14 ++++++
.../0000-0099/0061.Rotate List/README_EN.md | 14 ++++++
.../0000-0099/0062.Unique Paths/README.md | 38 ++++++++++++++++
.../0000-0099/0062.Unique Paths/README_EN.md | 38 ++++++++++++++++
.../0000-0099/0063.Unique Paths II/README.md | 24 ++++++++++
.../0063.Unique Paths II/README_EN.md | 22 ++++++++++
.../0000-0099/0064.Minimum Path Sum/README.md | 16 +++++++
.../0064.Minimum Path Sum/README_EN.md | 16 +++++++
.../0000-0099/0065.Valid Number/README.md | 12 +++++
.../0000-0099/0065.Valid Number/README_EN.md | 12 +++++
solution/0000-0099/0066.Plus One/README.md | 14 ++++++
solution/0000-0099/0066.Plus One/README_EN.md | 14 ++++++
solution/0000-0099/0067.Add Binary/README.md | 18 ++++++++
.../0000-0099/0067.Add Binary/README_EN.md | 18 ++++++++
.../0068.Text Justification/README.md | 12 +++++
.../0068.Text Justification/README_EN.md | 12 +++++
solution/0000-0099/0069.Sqrt(x)/README.md | 14 ++++++
solution/0000-0099/0069.Sqrt(x)/README_EN.md | 14 ++++++
.../0000-0099/0070.Climbing Stairs/README.md | 30 +++++++++++++
.../0070.Climbing Stairs/README_EN.md | 30 +++++++++++++
.../0000-0099/0071.Simplify Path/README.md | 16 +++++++
.../0000-0099/0071.Simplify Path/README_EN.md | 16 +++++++
.../0000-0099/0072.Edit Distance/README.md | 12 +++++
.../0000-0099/0072.Edit Distance/README_EN.md | 12 +++++
.../0073.Set Matrix Zeroes/README.md | 28 ++++++++++++
.../0073.Set Matrix Zeroes/README_EN.md | 28 ++++++++++++
.../0074.Search a 2D Matrix/README.md | 26 +++++++++++
.../0074.Search a 2D Matrix/README_EN.md | 26 +++++++++++
solution/0000-0099/0075.Sort Colors/README.md | 14 ++++++
.../0000-0099/0075.Sort Colors/README_EN.md | 14 ++++++
.../0076.Minimum Window Substring/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0000-0099/0077.Combinations/README.md | 28 ++++++++++++
.../0000-0099/0077.Combinations/README_EN.md | 28 ++++++++++++
solution/0000-0099/0078.Subsets/README.md | 22 ++++++++++
solution/0000-0099/0078.Subsets/README_EN.md | 22 ++++++++++
solution/0000-0099/0079.Word Search/README.md | 14 ++++++
.../0000-0099/0079.Word Search/README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0085.Maximal Rectangle/README.md | 12 +++++
.../0085.Maximal Rectangle/README_EN.md | 12 +++++
.../0000-0099/0086.Partition List/README.md | 12 +++++
.../0086.Partition List/README_EN.md | 12 +++++
.../0000-0099/0087.Scramble String/README.md | 24 ++++++++++
.../0087.Scramble String/README_EN.md | 24 ++++++++++
.../0088.Merge Sorted Array/README.md | 18 ++++++++
.../0088.Merge Sorted Array/README_EN.md | 18 ++++++++
solution/0000-0099/0089.Gray Code/README.md | 10 +++++
.../0000-0099/0089.Gray Code/README_EN.md | 10 +++++
solution/0000-0099/0090.Subsets II/README.md | 24 ++++++++++
.../0000-0099/0090.Subsets II/README_EN.md | 24 ++++++++++
solution/0000-0099/0091.Decode Ways/README.md | 24 ++++++++++
.../0000-0099/0091.Decode Ways/README_EN.md | 24 ++++++++++
.../0092.Reverse Linked List II/README.md | 16 +++++++
.../0092.Reverse Linked List II/README_EN.md | 16 +++++++
.../0093.Restore IP Addresses/README.md | 12 +++++
.../0093.Restore IP Addresses/README_EN.md | 12 +++++
.../README.md | 40 +++++++++++++++++
.../README_EN.md | 40 +++++++++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0096.Unique Binary Search Trees/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0097.Interleaving String/README.md | 38 ++++++++++++++++
.../0097.Interleaving String/README_EN.md | 38 ++++++++++++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0099.Recover Binary Search Tree/README.md | 12 +++++
.../README_EN.md | 12 +++++
solution/0100-0199/0100.Same Tree/README.md | 28 ++++++++++++
.../0100-0199/0100.Same Tree/README_EN.md | 28 ++++++++++++
.../0100-0199/0101.Symmetric Tree/README.md | 16 +++++++
.../0101.Symmetric Tree/README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0110.Balanced Binary Tree/README.md | 14 ++++++
.../0110.Balanced Binary Tree/README_EN.md | 14 ++++++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
solution/0100-0199/0112.Path Sum/README.md | 14 ++++++
solution/0100-0199/0112.Path Sum/README_EN.md | 14 ++++++
solution/0100-0199/0113.Path Sum II/README.md | 12 +++++
.../0100-0199/0113.Path Sum II/README_EN.md | 12 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0115.Distinct Subsequences/README.md | 22 ++++++++++
.../0115.Distinct Subsequences/README_EN.md | 22 ++++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../0118.Pascal's Triangle/README.md | 14 ++++++
.../0118.Pascal's Triangle/README_EN.md | 14 ++++++
.../0119.Pascal's Triangle II/README.md | 12 +++++
.../0119.Pascal's Triangle II/README_EN.md | 12 +++++
solution/0100-0199/0120.Triangle/README.md | 26 +++++++++++
solution/0100-0199/0120.Triangle/README_EN.md | 26 +++++++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 34 ++++++++++++++
.../README_EN.md | 34 ++++++++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0100-0199/0125.Valid Palindrome/README.md | 18 ++++++++
.../0125.Valid Palindrome/README_EN.md | 18 ++++++++
.../0100-0199/0126.Word Ladder II/README.md | 6 +++
.../0126.Word Ladder II/README_EN.md | 6 +++
solution/0100-0199/0127.Word Ladder/README.md | 18 ++++++++
.../0100-0199/0127.Word Ladder/README_EN.md | 18 ++++++++
.../README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../0129.Sum Root to Leaf Numbers/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0130.Surrounded Regions/README.md | 24 ++++++++++
.../0130.Surrounded Regions/README_EN.md | 24 ++++++++++
.../0131.Palindrome Partitioning/README.md | 12 +++++
.../0131.Palindrome Partitioning/README_EN.md | 12 +++++
.../0132.Palindrome Partitioning II/README.md | 12 +++++
.../README_EN.md | 12 +++++
solution/0100-0199/0133.Clone Graph/README.md | 12 +++++
.../0100-0199/0133.Clone Graph/README_EN.md | 12 +++++
solution/0100-0199/0134.Gas Station/README.md | 12 +++++
.../0100-0199/0134.Gas Station/README_EN.md | 12 +++++
solution/0100-0199/0135.Candy/README.md | 14 ++++++
solution/0100-0199/0135.Candy/README_EN.md | 14 ++++++
.../0100-0199/0136.Single Number/README.md | 22 ++++++++++
.../0100-0199/0136.Single Number/README_EN.md | 22 ++++++++++
.../0100-0199/0137.Single Number II/README.md | 28 ++++++++++++
.../0137.Single Number II/README_EN.md | 28 ++++++++++++
.../README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
solution/0100-0199/0139.Word Break/README.md | 26 +++++++++++
.../0100-0199/0139.Word Break/README_EN.md | 26 +++++++++++
.../0100-0199/0140.Word Break II/README.md | 8 ++++
.../0100-0199/0140.Word Break II/README_EN.md | 8 ++++
.../0141.Linked List Cycle/README.md | 24 ++++++++++
.../0141.Linked List Cycle/README_EN.md | 24 ++++++++++
.../0142.Linked List Cycle II/README.md | 12 +++++
.../0142.Linked List Cycle II/README_EN.md | 12 +++++
.../0100-0199/0143.Reorder List/README.md | 16 +++++++
.../0100-0199/0143.Reorder List/README_EN.md | 16 +++++++
.../README.md | 32 ++++++++++++++
.../README_EN.md | 32 ++++++++++++++
.../README.md | 32 ++++++++++++++
.../README_EN.md | 32 ++++++++++++++
solution/0100-0199/0146.LRU Cache/README.md | 14 ++++++
.../0100-0199/0146.LRU Cache/README_EN.md | 14 ++++++
.../0147.Insertion Sort List/README.md | 6 +++
.../0147.Insertion Sort List/README_EN.md | 6 +++
solution/0100-0199/0148.Sort List/README.md | 16 +++++++
.../0100-0199/0148.Sort List/README_EN.md | 16 +++++++
.../0149.Max Points on a Line/README.md | 18 ++++++++
.../0149.Max Points on a Line/README_EN.md | 18 ++++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0151.Reverse Words in a String/README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../0152.Maximum Product Subarray/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
solution/0100-0199/0155.Min Stack/README.md | 16 +++++++
.../0100-0199/0155.Min Stack/README_EN.md | 16 +++++++
.../0156.Binary Tree Upside Down/README.md | 8 ++++
.../0156.Binary Tree Upside Down/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0161.One Edit Distance/README.md | 10 +++++
.../0161.One Edit Distance/README_EN.md | 10 +++++
.../0162.Find Peak Element/README.md | 10 +++++
.../0162.Find Peak Element/README_EN.md | 10 +++++
.../0100-0199/0163.Missing Ranges/README.md | 10 +++++
.../0163.Missing Ranges/README_EN.md | 10 +++++
solution/0100-0199/0164.Maximum Gap/README.md | 10 +++++
.../0100-0199/0164.Maximum Gap/README_EN.md | 10 +++++
.../0165.Compare Version Numbers/README.md | 12 +++++
.../0165.Compare Version Numbers/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../0168.Excel Sheet Column Title/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0100-0199/0169.Majority Element/README.md | 18 ++++++++
.../0169.Majority Element/README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0171.Excel Sheet Column Number/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0172.Factorial Trailing Zeroes/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../0100-0199/0174.Dungeon Game/README.md | 10 +++++
.../0100-0199/0174.Dungeon Game/README_EN.md | 10 +++++
.../0175.Combine Two Tables/README.md | 4 ++
.../0175.Combine Two Tables/README_EN.md | 4 ++
.../0176.Second Highest Salary/README.md | 8 ++++
.../0176.Second Highest Salary/README_EN.md | 8 ++++
.../0177.Nth Highest Salary/README.md | 4 ++
.../0177.Nth Highest Salary/README_EN.md | 4 ++
solution/0100-0199/0178.Rank Scores/README.md | 6 +++
.../0100-0199/0178.Rank Scores/README_EN.md | 6 +++
.../0100-0199/0179.Largest Number/README.md | 10 +++++
.../0179.Largest Number/README_EN.md | 10 +++++
.../0180.Consecutive Numbers/README.md | 8 ++++
.../0180.Consecutive Numbers/README_EN.md | 8 ++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../0100-0199/0182.Duplicate Emails/README.md | 6 +++
.../0182.Duplicate Emails/README_EN.md | 6 +++
.../0183.Customers Who Never Order/README.md | 6 +++
.../README_EN.md | 6 +++
.../0184.Department Highest Salary/README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0187.Repeated DNA Sequences/README.md | 18 ++++++++
.../0187.Repeated DNA Sequences/README_EN.md | 18 ++++++++
.../README.md | 36 +++++++++++++++
.../README_EN.md | 36 +++++++++++++++
.../0100-0199/0189.Rotate Array/README.md | 18 ++++++++
.../0100-0199/0189.Rotate Array/README_EN.md | 18 ++++++++
.../0100-0199/0190.Reverse Bits/README.md | 12 +++++
.../0100-0199/0190.Reverse Bits/README_EN.md | 12 +++++
.../0100-0199/0191.Number of 1 Bits/README.md | 26 +++++++++++
.../0191.Number of 1 Bits/README_EN.md | 26 +++++++++++
.../0100-0199/0192.Word Frequency/README.md | 2 +
.../0192.Word Frequency/README_EN.md | 2 +
.../0193.Valid Phone Numbers/README.md | 2 +
.../0193.Valid Phone Numbers/README_EN.md | 2 +
.../0100-0199/0194.Transpose File/README.md | 2 +
.../0194.Transpose File/README_EN.md | 2 +
solution/0100-0199/0195.Tenth Line/README.md | 2 +
.../0100-0199/0195.Tenth Line/README_EN.md | 2 +
.../0196.Delete Duplicate Emails/README.md | 8 ++++
.../0196.Delete Duplicate Emails/README_EN.md | 8 ++++
.../0197.Rising Temperature/README.md | 6 +++
.../0197.Rising Temperature/README_EN.md | 6 +++
.../0100-0199/0198.House Robber/README.md | 22 ++++++++++
.../0100-0199/0198.House Robber/README_EN.md | 22 ++++++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../0200.Number of Islands/README.md | 38 ++++++++++++++++
.../0200.Number of Islands/README_EN.md | 38 ++++++++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0200-0299/0202.Happy Number/README.md | 26 +++++++++++
.../0200-0299/0202.Happy Number/README_EN.md | 26 +++++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0200-0299/0204.Count Primes/README.md | 12 +++++
.../0200-0299/0204.Count Primes/README_EN.md | 12 +++++
.../0205.Isomorphic Strings/README.md | 18 ++++++++
.../0205.Isomorphic Strings/README_EN.md | 18 ++++++++
.../0206.Reverse Linked List/README.md | 28 ++++++++++++
.../0206.Reverse Linked List/README_EN.md | 28 ++++++++++++
.../0200-0299/0207.Course Schedule/README.md | 14 ++++++
.../0207.Course Schedule/README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0209.Minimum Size Subarray Sum/README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../0210.Course Schedule II/README.md | 14 ++++++
.../0210.Course Schedule II/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0200-0299/0212.Word Search II/README.md | 10 +++++
.../0212.Word Search II/README_EN.md | 10 +++++
.../0200-0299/0213.House Robber II/README.md | 12 +++++
.../0213.House Robber II/README_EN.md | 12 +++++
.../0214.Shortest Palindrome/README.md | 12 +++++
.../0214.Shortest Palindrome/README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0216.Combination Sum III/README.md | 38 ++++++++++++++++
.../0216.Combination Sum III/README_EN.md | 38 ++++++++++++++++
.../0217.Contains Duplicate/README.md | 32 ++++++++++++++
.../0217.Contains Duplicate/README_EN.md | 32 ++++++++++++++
.../0218.The Skyline Problem/README.md | 8 ++++
.../0218.The Skyline Problem/README_EN.md | 8 ++++
.../0219.Contains Duplicate II/README.md | 14 ++++++
.../0219.Contains Duplicate II/README_EN.md | 14 ++++++
.../0220.Contains Duplicate III/README.md | 12 +++++
.../0220.Contains Duplicate III/README_EN.md | 12 +++++
.../0200-0299/0221.Maximal Square/README.md | 10 +++++
.../0221.Maximal Square/README_EN.md | 10 +++++
.../0222.Count Complete Tree Nodes/README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../0200-0299/0223.Rectangle Area/README.md | 12 +++++
.../0223.Rectangle Area/README_EN.md | 12 +++++
.../0200-0299/0224.Basic Calculator/README.md | 12 +++++
.../0224.Basic Calculator/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0226.Invert Binary Tree/README.md | 26 +++++++++++
.../0226.Invert Binary Tree/README_EN.md | 26 +++++++++++
.../0227.Basic Calculator II/README.md | 10 +++++
.../0227.Basic Calculator II/README_EN.md | 10 +++++
.../0200-0299/0228.Summary Ranges/README.md | 14 ++++++
.../0228.Summary Ranges/README_EN.md | 14 ++++++
.../0229.Majority Element II/README.md | 12 +++++
.../0229.Majority Element II/README_EN.md | 12 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0200-0299/0231.Power of Two/README.md | 24 ++++++++++
.../0200-0299/0231.Power of Two/README_EN.md | 24 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0233.Number of Digit One/README.md | 10 +++++
.../0233.Number of Digit One/README_EN.md | 10 +++++
.../0234.Palindrome Linked List/README.md | 14 ++++++
.../0234.Palindrome Linked List/README_EN.md | 14 ++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0239.Sliding Window Maximum/README.md | 22 ++++++++++
.../0239.Sliding Window Maximum/README_EN.md | 22 ++++++++++
.../0240.Search a 2D Matrix II/README.md | 28 ++++++++++++
.../0240.Search a 2D Matrix II/README_EN.md | 28 ++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0200-0299/0242.Valid Anagram/README.md | 24 ++++++++++
.../0200-0299/0242.Valid Anagram/README_EN.md | 24 ++++++++++
.../0243.Shortest Word Distance/README.md | 8 ++++
.../0243.Shortest Word Distance/README_EN.md | 8 ++++
.../0244.Shortest Word Distance II/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0245.Shortest Word Distance III/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0246.Strobogrammatic Number/README.md | 8 ++++
.../0246.Strobogrammatic Number/README_EN.md | 8 ++++
.../0247.Strobogrammatic Number II/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0248.Strobogrammatic Number III/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0249.Group Shifted Strings/README.md | 8 ++++
.../0249.Group Shifted Strings/README_EN.md | 8 ++++
.../0250.Count Univalue Subtrees/README.md | 12 +++++
.../0250.Count Univalue Subtrees/README_EN.md | 12 +++++
.../0251.Flatten 2D Vector/README.md | 10 +++++
.../0251.Flatten 2D Vector/README_EN.md | 10 +++++
.../0200-0299/0252.Meeting Rooms/README.md | 12 +++++
.../0200-0299/0252.Meeting Rooms/README_EN.md | 12 +++++
.../0200-0299/0253.Meeting Rooms II/README.md | 10 +++++
.../0253.Meeting Rooms II/README_EN.md | 10 +++++
.../0254.Factor Combinations/README.md | 8 ++++
.../0254.Factor Combinations/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
solution/0200-0299/0256.Paint House/README.md | 10 +++++
.../0200-0299/0256.Paint House/README_EN.md | 10 +++++
.../0257.Binary Tree Paths/README.md | 10 +++++
.../0257.Binary Tree Paths/README_EN.md | 10 +++++
solution/0200-0299/0258.Add Digits/README.md | 12 +++++
.../0200-0299/0258.Add Digits/README_EN.md | 12 +++++
.../0200-0299/0259.3Sum Smaller/README.md | 10 +++++
.../0200-0299/0259.3Sum Smaller/README_EN.md | 10 +++++
.../0260.Single Number III/README.md | 16 +++++++
.../0260.Single Number III/README_EN.md | 16 +++++++
.../0200-0299/0261.Graph Valid Tree/README.md | 20 +++++++++
.../0261.Graph Valid Tree/README_EN.md | 20 +++++++++
.../0200-0299/0262.Trips and Users/README.md | 4 ++
.../0262.Trips and Users/README_EN.md | 4 ++
solution/0200-0299/0263.Ugly Number/README.md | 12 +++++
.../0200-0299/0263.Ugly Number/README_EN.md | 12 +++++
.../0200-0299/0264.Ugly Number II/README.md | 20 +++++++++
.../0264.Ugly Number II/README_EN.md | 20 +++++++++
.../0200-0299/0265.Paint House II/README.md | 8 ++++
.../0265.Paint House II/README_EN.md | 8 ++++
.../0266.Palindrome Permutation/README.md | 12 +++++
.../0266.Palindrome Permutation/README_EN.md | 12 +++++
.../0267.Palindrome Permutation II/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0200-0299/0268.Missing Number/README.md | 30 +++++++++++++
.../0268.Missing Number/README_EN.md | 30 +++++++++++++
.../0200-0299/0269.Alien Dictionary/README.md | 6 +++
.../0269.Alien Dictionary/README_EN.md | 6 +++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0271.Encode and Decode Strings/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0273.Integer to English Words/README.md | 8 ++++
.../README_EN.md | 8 ++++
solution/0200-0299/0274.H-Index/README.md | 32 ++++++++++++++
solution/0200-0299/0274.H-Index/README_EN.md | 32 ++++++++++++++
solution/0200-0299/0275.H-Index II/README.md | 14 ++++++
.../0200-0299/0275.H-Index II/README_EN.md | 14 ++++++
solution/0200-0299/0276.Paint Fence/README.md | 20 +++++++++
.../0200-0299/0276.Paint Fence/README_EN.md | 20 +++++++++
.../0277.Find the Celebrity/README.md | 8 ++++
.../0277.Find the Celebrity/README_EN.md | 8 ++++
.../0278.First Bad Version/README.md | 12 +++++
.../0278.First Bad Version/README_EN.md | 12 +++++
.../0200-0299/0279.Perfect Squares/README.md | 24 ++++++++++
.../0279.Perfect Squares/README_EN.md | 24 ++++++++++
solution/0200-0299/0280.Wiggle Sort/README.md | 8 ++++
.../0200-0299/0280.Wiggle Sort/README_EN.md | 8 ++++
.../0200-0299/0281.Zigzag Iterator/README.md | 6 +++
.../0281.Zigzag Iterator/README_EN.md | 6 +++
.../0282.Expression Add Operators/README.md | 6 +++
.../README_EN.md | 6 +++
solution/0200-0299/0283.Move Zeroes/README.md | 16 +++++++
.../0200-0299/0283.Move Zeroes/README_EN.md | 16 +++++++
.../0200-0299/0284.Peeking Iterator/README.md | 8 ++++
.../0284.Peeking Iterator/README_EN.md | 8 ++++
.../0285.Inorder Successor in BST/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0200-0299/0286.Walls and Gates/README.md | 8 ++++
.../0286.Walls and Gates/README_EN.md | 8 ++++
.../0287.Find the Duplicate Number/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0288.Unique Word Abbreviation/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0200-0299/0289.Game of Life/README.md | 14 ++++++
.../0200-0299/0289.Game of Life/README_EN.md | 14 ++++++
.../0200-0299/0290.Word Pattern/README.md | 14 ++++++
.../0200-0299/0290.Word Pattern/README_EN.md | 14 ++++++
.../0200-0299/0291.Word Pattern II/README.md | 8 ++++
.../0291.Word Pattern II/README_EN.md | 8 ++++
solution/0200-0299/0292.Nim Game/README.md | 12 +++++
solution/0200-0299/0292.Nim Game/README_EN.md | 12 +++++
solution/0200-0299/0293.Flip Game/README.md | 10 +++++
.../0200-0299/0293.Flip Game/README_EN.md | 10 +++++
.../0200-0299/0294.Flip Game II/README.md | 16 +++++++
.../0200-0299/0294.Flip Game II/README_EN.md | 16 +++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0296.Best Meeting Point/README.md | 10 +++++
.../0296.Best Meeting Point/README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0200-0299/0299.Bulls and Cows/README.md | 12 +++++
.../0299.Bulls and Cows/README_EN.md | 12 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../0301.Remove Invalid Parentheses/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0305.Number of Islands II/README.md | 10 +++++
.../0305.Number of Islands II/README_EN.md | 10 +++++
.../0300-0399/0306.Additive Number/README.md | 8 ++++
.../0306.Additive Number/README_EN.md | 8 ++++
.../0307.Range Sum Query - Mutable/README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../0310.Minimum Height Trees/README.md | 10 +++++
.../0310.Minimum Height Trees/README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0300-0399/0312.Burst Balloons/README.md | 10 +++++
.../0312.Burst Balloons/README_EN.md | 10 +++++
.../0313.Super Ugly Number/README.md | 10 +++++
.../0313.Super Ugly Number/README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0316.Remove Duplicate Letters/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0300-0399/0319.Bulb Switcher/README.md | 10 +++++
.../0300-0399/0319.Bulb Switcher/README_EN.md | 10 +++++
.../0320.Generalized Abbreviation/README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../0321.Create Maximum Number/README.md | 10 +++++
.../0321.Create Maximum Number/README_EN.md | 10 +++++
solution/0300-0399/0322.Coin Change/README.md | 26 +++++++++++
.../0300-0399/0322.Coin Change/README_EN.md | 26 +++++++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../0300-0399/0324.Wiggle Sort II/README.md | 18 ++++++++
.../0324.Wiggle Sort II/README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0300-0399/0326.Power of Three/README.md | 20 +++++++++
.../0326.Power of Three/README_EN.md | 20 +++++++++
.../0327.Count of Range Sum/README.md | 10 +++++
.../0327.Count of Range Sum/README_EN.md | 10 +++++
.../0328.Odd Even Linked List/README.md | 10 +++++
.../0328.Odd Even Linked List/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0300-0399/0330.Patching Array/README.md | 10 +++++
.../0330.Patching Array/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0332.Reconstruct Itinerary/README.md | 6 +++
.../0332.Reconstruct Itinerary/README_EN.md | 6 +++
.../0333.Largest BST Subtree/README.md | 8 ++++
.../0333.Largest BST Subtree/README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0300-0399/0335.Self Crossing/README.md | 10 +++++
.../0300-0399/0335.Self Crossing/README_EN.md | 10 +++++
.../0300-0399/0336.Palindrome Pairs/README.md | 10 +++++
.../0336.Palindrome Pairs/README_EN.md | 10 +++++
.../0300-0399/0337.House Robber III/README.md | 10 +++++
.../0337.House Robber III/README_EN.md | 10 +++++
.../0300-0399/0338.Counting Bits/README.md | 20 +++++++++
.../0300-0399/0338.Counting Bits/README_EN.md | 20 +++++++++
.../0339.Nested List Weight Sum/README.md | 6 +++
.../0339.Nested List Weight Sum/README_EN.md | 6 +++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0300-0399/0342.Power of Four/README.md | 12 +++++
.../0300-0399/0342.Power of Four/README_EN.md | 12 +++++
.../0300-0399/0343.Integer Break/README.md | 24 ++++++++++
.../0300-0399/0343.Integer Break/README_EN.md | 24 ++++++++++
.../0300-0399/0344.Reverse String/README.md | 18 ++++++++
.../0344.Reverse String/README_EN.md | 18 ++++++++
.../0345.Reverse Vowels of a String/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0347.Top K Frequent Elements/README.md | 18 ++++++++
.../0347.Top K Frequent Elements/README_EN.md | 18 ++++++++
.../0348.Design Tic-Tac-Toe/README.md | 4 ++
.../0348.Design Tic-Tac-Toe/README_EN.md | 4 ++
.../0349.Intersection of Two Arrays/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../0351.Android Unlock Patterns/README.md | 10 +++++
.../0351.Android Unlock Patterns/README_EN.md | 10 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../0353.Design Snake Game/README.md | 10 +++++
.../0353.Design Snake Game/README_EN.md | 10 +++++
.../0354.Russian Doll Envelopes/README.md | 8 ++++
.../0354.Russian Doll Envelopes/README_EN.md | 8 ++++
.../0300-0399/0355.Design Twitter/README.md | 4 ++
.../0355.Design Twitter/README_EN.md | 4 ++
.../0300-0399/0356.Line Reflection/README.md | 8 ++++
.../0356.Line Reflection/README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0359.Logger Rate Limiter/README.md | 6 +++
.../0359.Logger Rate Limiter/README_EN.md | 6 +++
.../0360.Sort Transformed Array/README.md | 8 ++++
.../0360.Sort Transformed Array/README_EN.md | 8 ++++
solution/0300-0399/0361.Bomb Enemy/README.md | 8 ++++
.../0300-0399/0361.Bomb Enemy/README_EN.md | 8 ++++
.../0362.Design Hit Counter/README.md | 6 +++
.../0362.Design Hit Counter/README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0364.Nested List Weight Sum II/README.md | 6 +++
.../README_EN.md | 6 +++
.../0365.Water and Jug Problem/README.md | 8 ++++
.../0365.Water and Jug Problem/README_EN.md | 8 ++++
.../0366.Find Leaves of Binary Tree/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0367.Valid Perfect Square/README.md | 24 ++++++++++
.../0367.Valid Perfect Square/README_EN.md | 24 ++++++++++
.../0368.Largest Divisible Subset/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0369.Plus One Linked List/README.md | 8 ++++
.../0369.Plus One Linked List/README_EN.md | 8 ++++
.../0300-0399/0370.Range Addition/README.md | 18 ++++++++
.../0370.Range Addition/README_EN.md | 18 ++++++++
.../0371.Sum of Two Integers/README.md | 8 ++++
.../0371.Sum of Two Integers/README_EN.md | 8 ++++
solution/0300-0399/0372.Super Pow/README.md | 10 +++++
.../0300-0399/0372.Super Pow/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0376.Wiggle Subsequence/README.md | 10 +++++
.../0376.Wiggle Subsequence/README_EN.md | 10 +++++
.../0377.Combination Sum IV/README.md | 14 ++++++
.../0377.Combination Sum IV/README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0379.Design Phone Directory/README.md | 4 ++
.../0379.Design Phone Directory/README_EN.md | 4 ++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../0382.Linked List Random Node/README.md | 8 ++++
.../0382.Linked List Random Node/README_EN.md | 8 ++++
solution/0300-0399/0383.Ransom Note/README.md | 14 ++++++
.../0300-0399/0383.Ransom Note/README_EN.md | 14 ++++++
.../0300-0399/0384.Shuffle an Array/README.md | 14 ++++++
.../0384.Shuffle an Array/README_EN.md | 14 ++++++
solution/0300-0399/0385.Mini Parser/README.md | 20 +++++++++
.../0300-0399/0385.Mini Parser/README_EN.md | 20 +++++++++
.../0386.Lexicographical Numbers/README.md | 18 ++++++++
.../0386.Lexicographical Numbers/README_EN.md | 18 ++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0388.Longest Absolute File Path/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0389.Find the Difference/README.md | 28 ++++++++++++
.../0389.Find the Difference/README_EN.md | 28 ++++++++++++
.../0300-0399/0390.Elimination Game/README.md | 8 ++++
.../0390.Elimination Game/README_EN.md | 8 ++++
.../0391.Perfect Rectangle/README.md | 8 ++++
.../0391.Perfect Rectangle/README_EN.md | 8 ++++
.../0300-0399/0392.Is Subsequence/README.md | 16 +++++++
.../0392.Is Subsequence/README_EN.md | 16 +++++++
.../0300-0399/0393.UTF-8 Validation/README.md | 8 ++++
.../0393.UTF-8 Validation/README_EN.md | 8 ++++
.../0300-0399/0394.Decode String/README.md | 6 +++
.../0300-0399/0394.Decode String/README_EN.md | 6 +++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0300-0399/0396.Rotate Function/README.md | 12 +++++
.../0396.Rotate Function/README_EN.md | 12 +++++
.../0397.Integer Replacement/README.md | 8 ++++
.../0397.Integer Replacement/README_EN.md | 8 ++++
.../0398.Random Pick Index/README.md | 8 ++++
.../0398.Random Pick Index/README_EN.md | 8 ++++
.../0399.Evaluate Division/README.md | 10 +++++
.../0399.Evaluate Division/README_EN.md | 10 +++++
solution/0400-0499/0400.Nth Digit/README.md | 12 +++++
.../0400-0499/0400.Nth Digit/README_EN.md | 12 +++++
.../0400-0499/0401.Binary Watch/README.md | 20 +++++++++
.../0400-0499/0401.Binary Watch/README_EN.md | 20 +++++++++
.../0400-0499/0402.Remove K Digits/README.md | 10 +++++
.../0402.Remove K Digits/README_EN.md | 10 +++++
solution/0400-0499/0403.Frog Jump/README.md | 24 ++++++++++
.../0400-0499/0403.Frog Jump/README_EN.md | 24 ++++++++++
.../0404.Sum of Left Leaves/README.md | 24 ++++++++++
.../0404.Sum of Left Leaves/README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0407.Trapping Rain Water II/README.md | 8 ++++
.../0407.Trapping Rain Water II/README_EN.md | 8 ++++
.../0408.Valid Word Abbreviation/README.md | 10 +++++
.../0408.Valid Word Abbreviation/README_EN.md | 10 +++++
.../0409.Longest Palindrome/README.md | 14 ++++++
.../0409.Longest Palindrome/README_EN.md | 14 ++++++
.../0410.Split Array Largest Sum/README.md | 10 +++++
.../0410.Split Array Largest Sum/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
solution/0400-0499/0412.Fizz Buzz/README.md | 12 +++++
.../0400-0499/0412.Fizz Buzz/README_EN.md | 12 +++++
.../0413.Arithmetic Slices/README.md | 12 +++++
.../0413.Arithmetic Slices/README_EN.md | 12 +++++
.../0414.Third Maximum Number/README.md | 8 ++++
.../0414.Third Maximum Number/README_EN.md | 8 ++++
solution/0400-0499/0415.Add Strings/README.md | 14 ++++++
.../0400-0499/0415.Add Strings/README_EN.md | 14 ++++++
.../0416.Partition Equal Subset Sum/README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0418.Sentence Screen Fitting/README.md | 10 +++++
.../0418.Sentence Screen Fitting/README_EN.md | 10 +++++
.../0419.Battleships in a Board/README.md | 8 ++++
.../0419.Battleships in a Board/README_EN.md | 8 ++++
.../0420.Strong Password Checker/README.md | 6 +++
.../0420.Strong Password Checker/README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0422.Valid Word Square/README.md | 12 +++++
.../0422.Valid Word Square/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0400-0499/0425.Word Squares/README.md | 6 +++
.../0400-0499/0425.Word Squares/README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0427.Construct Quad Tree/README.md | 8 ++++
.../0427.Construct Quad Tree/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0432.All O`one Data Structure/README.md | 4 ++
.../README_EN.md | 4 ++
.../0433.Minimum Genetic Mutation/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../0435.Non-overlapping Intervals/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0436.Find Right Interval/README.md | 10 +++++
.../0436.Find Right Interval/README_EN.md | 10 +++++
.../0400-0499/0437.Path Sum III/README.md | 10 +++++
.../0400-0499/0437.Path Sum III/README_EN.md | 10 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../0439.Ternary Expression Parser/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0400-0499/0441.Arranging Coins/README.md | 12 +++++
.../0441.Arranging Coins/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0443.String Compression/README.md | 10 +++++
.../0443.String Compression/README_EN.md | 10 +++++
.../0444.Sequence Reconstruction/README.md | 10 +++++
.../0444.Sequence Reconstruction/README_EN.md | 10 +++++
.../0445.Add Two Numbers II/README.md | 14 ++++++
.../0445.Add Two Numbers II/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0447.Number of Boomerangs/README.md | 20 +++++++++
.../0447.Number of Boomerangs/README_EN.md | 20 +++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0450.Delete Node in a BST/README.md | 12 +++++
.../0450.Delete Node in a BST/README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
solution/0400-0499/0454.4Sum II/README.md | 10 +++++
solution/0400-0499/0454.4Sum II/README_EN.md | 10 +++++
.../0400-0499/0455.Assign Cookies/README.md | 12 +++++
.../0455.Assign Cookies/README_EN.md | 12 +++++
solution/0400-0499/0456.132 Pattern/README.md | 22 ++++++++++
.../0400-0499/0456.132 Pattern/README_EN.md | 22 ++++++++++
.../0457.Circular Array Loop/README.md | 8 ++++
.../0457.Circular Array Loop/README_EN.md | 8 ++++
solution/0400-0499/0458.Poor Pigs/README.md | 8 ++++
.../0400-0499/0458.Poor Pigs/README_EN.md | 8 ++++
.../0459.Repeated Substring Pattern/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
solution/0400-0499/0460.LFU Cache/README.md | 10 +++++
.../0400-0499/0460.LFU Cache/README_EN.md | 10 +++++
.../0400-0499/0461.Hamming Distance/README.md | 12 +++++
.../0461.Hamming Distance/README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0400-0499/0463.Island Perimeter/README.md | 10 +++++
.../0463.Island Perimeter/README_EN.md | 10 +++++
solution/0400-0499/0464.Can I Win/README.md | 8 ++++
.../0400-0499/0464.Can I Win/README_EN.md | 8 ++++
.../0465.Optimal Account Balancing/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0466.Count The Repetitions/README.md | 10 +++++
.../0466.Count The Repetitions/README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0468.Validate IP Address/README.md | 6 +++
.../0468.Validate IP Address/README_EN.md | 6 +++
.../0400-0499/0469.Convex Polygon/README.md | 8 ++++
.../0469.Convex Polygon/README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0472.Concatenated Words/README.md | 8 ++++
.../0472.Concatenated Words/README_EN.md | 8 ++++
.../0473.Matchsticks to Square/README.md | 12 +++++
.../0473.Matchsticks to Square/README_EN.md | 12 +++++
.../0400-0499/0474.Ones and Zeroes/README.md | 20 +++++++++
.../0474.Ones and Zeroes/README_EN.md | 20 +++++++++
solution/0400-0499/0475.Heaters/README.md | 10 +++++
solution/0400-0499/0475.Heaters/README_EN.md | 10 +++++
.../0476.Number Complement/README.md | 10 +++++
.../0476.Number Complement/README_EN.md | 10 +++++
.../0477.Total Hamming Distance/README.md | 12 +++++
.../0477.Total Hamming Distance/README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../0479.Largest Palindrome Product/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0480.Sliding Window Median/README.md | 8 ++++
.../0480.Sliding Window Median/README_EN.md | 8 ++++
.../0400-0499/0481.Magical String/README.md | 12 +++++
.../0481.Magical String/README_EN.md | 12 +++++
.../0482.License Key Formatting/README.md | 8 ++++
.../0482.License Key Formatting/README_EN.md | 8 ++++
.../0483.Smallest Good Base/README.md | 6 +++
.../0483.Smallest Good Base/README_EN.md | 6 +++
.../0400-0499/0484.Find Permutation/README.md | 8 ++++
.../0484.Find Permutation/README_EN.md | 8 ++++
.../0485.Max Consecutive Ones/README.md | 16 +++++++
.../0485.Max Consecutive Ones/README_EN.md | 16 +++++++
.../0486.Predict the Winner/README.md | 22 ++++++++++
.../0486.Predict the Winner/README_EN.md | 22 ++++++++++
.../0487.Max Consecutive Ones II/README.md | 24 ++++++++++
.../0487.Max Consecutive Ones II/README_EN.md | 24 ++++++++++
solution/0400-0499/0488.Zuma Game/README.md | 4 ++
.../0400-0499/0488.Zuma Game/README_EN.md | 4 ++
.../0489.Robot Room Cleaner/README.md | 10 +++++
.../0489.Robot Room Cleaner/README_EN.md | 10 +++++
solution/0400-0499/0490.The Maze/README.md | 16 +++++++
solution/0400-0499/0490.The Maze/README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0492.Construct the Rectangle/README.md | 8 ++++
.../0492.Construct the Rectangle/README_EN.md | 8 ++++
.../0400-0499/0493.Reverse Pairs/README.md | 22 ++++++++++
.../0400-0499/0493.Reverse Pairs/README_EN.md | 22 ++++++++++
solution/0400-0499/0494.Target Sum/README.md | 24 ++++++++++
.../0400-0499/0494.Target Sum/README_EN.md | 24 ++++++++++
.../0400-0499/0495.Teemo Attacking/README.md | 12 +++++
.../0495.Teemo Attacking/README_EN.md | 12 +++++
.../0496.Next Greater Element I/README.md | 26 +++++++++++
.../0496.Next Greater Element I/README_EN.md | 26 +++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0498.Diagonal Traverse/README.md | 12 +++++
.../0498.Diagonal Traverse/README_EN.md | 12 +++++
.../0400-0499/0499.The Maze III/README.md | 8 ++++
.../0400-0499/0499.The Maze III/README_EN.md | 8 ++++
.../0500-0599/0500.Keyboard Row/README.md | 14 ++++++
.../0500-0599/0500.Keyboard Row/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
solution/0500-0599/0502.IPO/README.md | 8 ++++
solution/0500-0599/0502.IPO/README_EN.md | 8 ++++
.../0503.Next Greater Element II/README.md | 22 ++++++++++
.../0503.Next Greater Element II/README_EN.md | 22 ++++++++++
solution/0500-0599/0504.Base 7/README.md | 12 +++++
solution/0500-0599/0504.Base 7/README_EN.md | 12 +++++
solution/0500-0599/0505.The Maze II/README.md | 10 +++++
.../0500-0599/0505.The Maze II/README_EN.md | 10 +++++
.../0500-0599/0506.Relative Ranks/README.md | 8 ++++
.../0506.Relative Ranks/README_EN.md | 8 ++++
.../0500-0599/0507.Perfect Number/README.md | 8 ++++
.../0507.Perfect Number/README_EN.md | 8 ++++
.../0508.Most Frequent Subtree Sum/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0500-0599/0509.Fibonacci Number/README.md | 20 +++++++++
.../0509.Fibonacci Number/README_EN.md | 20 +++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0511.Game Play Analysis I/README.md | 4 ++
.../0511.Game Play Analysis I/README_EN.md | 4 ++
.../0512.Game Play Analysis II/README.md | 4 ++
.../0512.Game Play Analysis II/README_EN.md | 4 ++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../0500-0599/0514.Freedom Trail/README.md | 10 +++++
.../0500-0599/0514.Freedom Trail/README_EN.md | 10 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0517.Super Washing Machines/README.md | 10 +++++
.../0517.Super Washing Machines/README_EN.md | 10 +++++
.../0500-0599/0518.Coin Change II/README.md | 20 +++++++++
.../0518.Coin Change II/README_EN.md | 20 +++++++++
.../0519.Random Flip Matrix/README.md | 4 ++
.../0519.Random Flip Matrix/README_EN.md | 4 ++
.../0500-0599/0520.Detect Capital/README.md | 10 +++++
.../0520.Detect Capital/README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0523.Continuous Subarray Sum/README.md | 8 ++++
.../0523.Continuous Subarray Sum/README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0500-0599/0525.Contiguous Array/README.md | 10 +++++
.../0525.Contiguous Array/README_EN.md | 10 +++++
.../0526.Beautiful Arrangement/README.md | 14 ++++++
.../0526.Beautiful Arrangement/README_EN.md | 14 ++++++
.../0527.Word Abbreviation/README.md | 10 +++++
.../0527.Word Abbreviation/README_EN.md | 10 +++++
.../0528.Random Pick with Weight/README.md | 12 +++++
.../0528.Random Pick with Weight/README_EN.md | 12 +++++
solution/0500-0599/0529.Minesweeper/README.md | 10 +++++
.../0500-0599/0529.Minesweeper/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0500-0599/0531.Lonely Pixel I/README.md | 10 +++++
.../0531.Lonely Pixel I/README_EN.md | 10 +++++
.../0532.K-diff Pairs in an Array/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0500-0599/0533.Lonely Pixel II/README.md | 10 +++++
.../0533.Lonely Pixel II/README_EN.md | 10 +++++
.../0534.Game Play Analysis III/README.md | 6 +++
.../0534.Game Play Analysis III/README_EN.md | 6 +++
.../0535.Encode and Decode TinyURL/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../0539.Minimum Time Difference/README.md | 10 +++++
.../0539.Minimum Time Difference/README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0541.Reverse String II/README.md | 8 ++++
.../0541.Reverse String II/README_EN.md | 8 ++++
solution/0500-0599/0542.01 Matrix/README.md | 12 +++++
.../0500-0599/0542.01 Matrix/README_EN.md | 12 +++++
.../0543.Diameter of Binary Tree/README.md | 16 +++++++
.../0543.Diameter of Binary Tree/README_EN.md | 16 +++++++
.../0544.Output Contest Matches/README.md | 8 ++++
.../0544.Output Contest Matches/README_EN.md | 8 ++++
.../0545.Boundary of Binary Tree/README.md | 6 +++
.../0545.Boundary of Binary Tree/README_EN.md | 6 +++
.../0500-0599/0546.Remove Boxes/README.md | 8 ++++
.../0500-0599/0546.Remove Boxes/README_EN.md | 8 ++++
.../0547.Number of Provinces/README.md | 22 ++++++++++
.../0547.Number of Provinces/README_EN.md | 22 ++++++++++
.../0548.Split Array with Equal Sum/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0550.Game Play Analysis IV/README.md | 6 +++
.../0550.Game Play Analysis IV/README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0500-0599/0553.Optimal Division/README.md | 12 +++++
.../0553.Optimal Division/README_EN.md | 12 +++++
solution/0500-0599/0554.Brick Wall/README.md | 8 ++++
.../0500-0599/0554.Brick Wall/README_EN.md | 8 ++++
.../0555.Split Concatenated Strings/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0556.Next Greater Element III/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0560.Subarray Sum Equals K/README.md | 14 ++++++
.../0560.Subarray Sum Equals K/README_EN.md | 14 ++++++
.../0500-0599/0561.Array Partition/README.md | 12 +++++
.../0561.Array Partition/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0500-0599/0563.Binary Tree Tilt/README.md | 8 ++++
.../0563.Binary Tree Tilt/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0500-0599/0565.Array Nesting/README.md | 16 +++++++
.../0500-0599/0565.Array Nesting/README_EN.md | 16 +++++++
.../0566.Reshape the Matrix/README.md | 16 +++++++
.../0566.Reshape the Matrix/README_EN.md | 16 +++++++
.../0567.Permutation in String/README.md | 22 ++++++++++
.../0567.Permutation in String/README_EN.md | 22 ++++++++++
.../0568.Maximum Vacation Days/README.md | 8 ++++
.../0568.Maximum Vacation Days/README_EN.md | 8 ++++
.../0569.Median Employee Salary/README.md | 2 +
.../0569.Median Employee Salary/README_EN.md | 2 +
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 2 +
.../README_EN.md | 2 +
.../0572.Subtree of Another Tree/README.md | 14 ++++++
.../0572.Subtree of Another Tree/README_EN.md | 14 ++++++
.../0573.Squirrel Simulation/README.md | 8 ++++
.../0573.Squirrel Simulation/README_EN.md | 8 ++++
.../0574.Winning Candidate/README.md | 4 ++
.../0574.Winning Candidate/README_EN.md | 4 ++
.../0575.Distribute Candies/README.md | 8 ++++
.../0575.Distribute Candies/README_EN.md | 8 ++++
.../0576.Out of Boundary Paths/README.md | 10 +++++
.../0576.Out of Boundary Paths/README_EN.md | 10 +++++
.../0500-0599/0577.Employee Bonus/README.md | 2 +
.../0577.Employee Bonus/README_EN.md | 2 +
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../0500-0599/0582.Kill Process/README.md | 12 +++++
.../0500-0599/0582.Kill Process/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0584.Find Customer Referee/README.md | 2 +
.../0584.Find Customer Referee/README_EN.md | 2 +
.../0585.Investments in 2016/README.md | 2 +
.../0585.Investments in 2016/README_EN.md | 2 +
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../0500-0599/0587.Erect the Fence/README.md | 8 ++++
.../0587.Erect the Fence/README_EN.md | 8 ++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0500-0599/0591.Tag Validator/README.md | 10 +++++
.../0500-0599/0591.Tag Validator/README_EN.md | 10 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../0500-0599/0593.Valid Square/README.md | 8 ++++
.../0500-0599/0593.Valid Square/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0500-0599/0595.Big Countries/README.md | 4 ++
.../0500-0599/0595.Big Countries/README_EN.md | 4 ++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../0598.Range Addition II/README.md | 8 ++++
.../0598.Range Addition II/README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0601.Human Traffic of Stadium/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0605.Can Place Flowers/README.md | 14 ++++++
.../0605.Can Place Flowers/README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0600-0699/0607.Sales Person/README.md | 2 +
.../0600-0699/0607.Sales Person/README_EN.md | 2 +
solution/0600-0699/0608.Tree Node/README.md | 2 +
.../0600-0699/0608.Tree Node/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0610.Triangle Judgement/README.md | 2 +
.../0610.Triangle Judgement/README_EN.md | 2 +
.../0611.Valid Triangle Number/README.md | 14 ++++++
.../0611.Valid Triangle Number/README_EN.md | 14 ++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../0614.Second Degree Follower/README.md | 2 +
.../0614.Second Degree Follower/README_EN.md | 2 +
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../0616.Add Bold Tag in String/README.md | 8 ++++
.../0616.Add Bold Tag in String/README_EN.md | 8 ++++
.../0617.Merge Two Binary Trees/README.md | 14 ++++++
.../0617.Merge Two Binary Trees/README_EN.md | 14 ++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../0619.Biggest Single Number/README.md | 4 ++
.../0619.Biggest Single Number/README_EN.md | 4 ++
.../0620.Not Boring Movies/README.md | 2 +
.../0620.Not Boring Movies/README_EN.md | 2 +
.../0600-0699/0621.Task Scheduler/README.md | 10 +++++
.../0621.Task Scheduler/README_EN.md | 10 +++++
.../0622.Design Circular Queue/README.md | 12 +++++
.../0622.Design Circular Queue/README_EN.md | 12 +++++
.../0623.Add One Row to Tree/README.md | 20 +++++++++
.../0623.Add One Row to Tree/README_EN.md | 20 +++++++++
.../0624.Maximum Distance in Arrays/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0625.Minimum Factorization/README.md | 8 ++++
.../0625.Minimum Factorization/README_EN.md | 8 ++++
.../0600-0699/0626.Exchange Seats/README.md | 8 ++++
.../0626.Exchange Seats/README_EN.md | 8 ++++
solution/0600-0699/0627.Swap Salary/README.md | 4 ++
.../0600-0699/0627.Swap Salary/README_EN.md | 4 ++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0629.K Inverse Pairs Array/README.md | 10 +++++
.../0629.K Inverse Pairs Array/README_EN.md | 10 +++++
.../0630.Course Schedule III/README.md | 10 +++++
.../0630.Course Schedule III/README_EN.md | 10 +++++
.../0631.Design Excel Sum Formula/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0633.Sum of Square Numbers/README.md | 12 +++++
.../0633.Sum of Square Numbers/README_EN.md | 12 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0635.Design Log Storage System/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../0600-0699/0638.Shopping Offers/README.md | 8 ++++
.../0638.Shopping Offers/README_EN.md | 8 ++++
.../0600-0699/0639.Decode Ways II/README.md | 6 +++
.../0639.Decode Ways II/README_EN.md | 6 +++
.../0640.Solve the Equation/README.md | 8 ++++
.../0640.Solve the Equation/README_EN.md | 8 ++++
.../0641.Design Circular Deque/README.md | 10 +++++
.../0641.Design Circular Deque/README_EN.md | 10 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../0643.Maximum Average Subarray I/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0600-0699/0645.Set Mismatch/README.md | 34 ++++++++++++++
.../0600-0699/0645.Set Mismatch/README_EN.md | 34 ++++++++++++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../0647.Palindromic Substrings/README.md | 14 ++++++
.../0647.Palindromic Substrings/README_EN.md | 14 ++++++
.../0600-0699/0648.Replace Words/README.md | 12 +++++
.../0600-0699/0648.Replace Words/README_EN.md | 12 +++++
.../0600-0699/0649.Dota2 Senate/README.md | 12 +++++
.../0600-0699/0649.Dota2 Senate/README_EN.md | 12 +++++
.../0600-0699/0650.2 Keys Keyboard/README.md | 18 ++++++++
.../0650.2 Keys Keyboard/README_EN.md | 18 ++++++++
.../0600-0699/0651.4 Keys Keyboard/README.md | 8 ++++
.../0651.4 Keys Keyboard/README_EN.md | 8 ++++
.../0652.Find Duplicate Subtrees/README.md | 12 +++++
.../0652.Find Duplicate Subtrees/README_EN.md | 12 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../0654.Maximum Binary Tree/README.md | 30 +++++++++++++
.../0654.Maximum Binary Tree/README_EN.md | 30 +++++++++++++
.../0655.Print Binary Tree/README.md | 20 +++++++++
.../0655.Print Binary Tree/README_EN.md | 20 +++++++++
solution/0600-0699/0656.Coin Path/README.md | 10 +++++
.../0600-0699/0656.Coin Path/README_EN.md | 10 +++++
.../0657.Robot Return to Origin/README.md | 6 +++
.../0657.Robot Return to Origin/README_EN.md | 6 +++
.../0658.Find K Closest Elements/README.md | 32 ++++++++++++++
.../0658.Find K Closest Elements/README_EN.md | 32 ++++++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
solution/0600-0699/0660.Remove 9/README.md | 8 ++++
solution/0600-0699/0660.Remove 9/README_EN.md | 8 ++++
.../0600-0699/0661.Image Smoother/README.md | 12 +++++
.../0661.Image Smoother/README_EN.md | 12 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0663.Equal Tree Partition/README.md | 8 ++++
.../0663.Equal Tree Partition/README_EN.md | 8 ++++
.../0600-0699/0664.Strange Printer/README.md | 10 +++++
.../0664.Strange Printer/README_EN.md | 10 +++++
.../0665.Non-decreasing Array/README.md | 10 +++++
.../0665.Non-decreasing Array/README_EN.md | 10 +++++
solution/0600-0699/0666.Path Sum IV/README.md | 8 ++++
.../0600-0699/0666.Path Sum IV/README_EN.md | 8 ++++
.../0667.Beautiful Arrangement II/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0669.Trim a Binary Search Tree/README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../0600-0699/0670.Maximum Swap/README.md | 12 +++++
.../0600-0699/0670.Maximum Swap/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0600-0699/0672.Bulb Switcher II/README.md | 8 ++++
.../0672.Bulb Switcher II/README_EN.md | 8 ++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0676.Implement Magic Dictionary/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0600-0699/0677.Map Sum Pairs/README.md | 10 +++++
.../0600-0699/0677.Map Sum Pairs/README_EN.md | 10 +++++
.../0678.Valid Parenthesis String/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
solution/0600-0699/0679.24 Game/README.md | 10 +++++
solution/0600-0699/0679.24 Game/README_EN.md | 10 +++++
.../0680.Valid Palindrome II/README.md | 14 ++++++
.../0680.Valid Palindrome II/README_EN.md | 14 ++++++
.../0681.Next Closest Time/README.md | 4 ++
.../0681.Next Closest Time/README_EN.md | 4 ++
.../0600-0699/0682.Baseball Game/README.md | 12 +++++
.../0600-0699/0682.Baseball Game/README_EN.md | 12 +++++
.../0600-0699/0683.K Empty Slots/README.md | 10 +++++
.../0600-0699/0683.K Empty Slots/README_EN.md | 10 +++++
.../0684.Redundant Connection/README.md | 10 +++++
.../0684.Redundant Connection/README_EN.md | 10 +++++
.../0685.Redundant Connection II/README.md | 8 ++++
.../0685.Redundant Connection II/README_EN.md | 8 ++++
.../0686.Repeated String Match/README.md | 10 +++++
.../0686.Repeated String Match/README_EN.md | 10 +++++
.../0687.Longest Univalue Path/README.md | 16 +++++++
.../0687.Longest Univalue Path/README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../0690.Employee Importance/README.md | 6 +++
.../0690.Employee Importance/README_EN.md | 6 +++
.../0691.Stickers to Spell Word/README.md | 10 +++++
.../0691.Stickers to Spell Word/README_EN.md | 10 +++++
.../0692.Top K Frequent Words/README.md | 8 ++++
.../0692.Top K Frequent Words/README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0694.Number of Distinct Islands/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0695.Max Area of Island/README.md | 12 +++++
.../0695.Max Area of Island/README_EN.md | 12 +++++
.../0696.Count Binary Substrings/README.md | 8 ++++
.../0696.Count Binary Substrings/README_EN.md | 8 ++++
.../0697.Degree of an Array/README.md | 10 +++++
.../0697.Degree of an Array/README_EN.md | 10 +++++
.../README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../0600-0699/0699.Falling Squares/README.md | 8 ++++
.../0699.Falling Squares/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0700-0799/0704.Binary Search/README.md | 14 ++++++
.../0700-0799/0704.Binary Search/README_EN.md | 14 ++++++
.../0700-0799/0705.Design HashSet/README.md | 18 ++++++++
.../0705.Design HashSet/README_EN.md | 18 ++++++++
.../0700-0799/0706.Design HashMap/README.md | 10 +++++
.../0706.Design HashMap/README_EN.md | 10 +++++
.../0707.Design Linked List/README.md | 22 ++++++++++
.../0707.Design Linked List/README_EN.md | 22 ++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0700-0799/0709.To Lower Case/README.md | 18 ++++++++
.../0700-0799/0709.To Lower Case/README_EN.md | 18 ++++++++
.../0710.Random Pick with Blacklist/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../0700-0799/0715.Range Module/README.md | 10 +++++
.../0700-0799/0715.Range Module/README_EN.md | 10 +++++
solution/0700-0799/0716.Max Stack/README.md | 6 +++
.../0700-0799/0716.Max Stack/README_EN.md | 6 +++
.../0717.1-bit and 2-bit Characters/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0720.Longest Word in Dictionary/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0700-0799/0721.Accounts Merge/README.md | 6 +++
.../0721.Accounts Merge/README_EN.md | 6 +++
.../0700-0799/0722.Remove Comments/README.md | 12 +++++
.../0722.Remove Comments/README_EN.md | 12 +++++
solution/0700-0799/0723.Candy Crush/README.md | 8 ++++
.../0700-0799/0723.Candy Crush/README_EN.md | 8 ++++
.../0700-0799/0724.Find Pivot Index/README.md | 14 ++++++
.../0724.Find Pivot Index/README_EN.md | 14 ++++++
.../0725.Split Linked List in Parts/README.md | 4 ++
.../README_EN.md | 4 ++
.../0700-0799/0726.Number of Atoms/README.md | 8 ++++
.../0726.Number of Atoms/README_EN.md | 8 ++++
.../0727.Minimum Window Subsequence/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0728.Self Dividing Numbers/README.md | 10 +++++
.../0728.Self Dividing Numbers/README_EN.md | 10 +++++
.../0700-0799/0729.My Calendar I/README.md | 12 +++++
.../0700-0799/0729.My Calendar I/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0700-0799/0731.My Calendar II/README.md | 16 +++++++
.../0731.My Calendar II/README_EN.md | 16 +++++++
.../0700-0799/0732.My Calendar III/README.md | 8 ++++
.../0732.My Calendar III/README_EN.md | 8 ++++
solution/0700-0799/0733.Flood Fill/README.md | 20 +++++++++
.../0700-0799/0733.Flood Fill/README_EN.md | 20 +++++++++
.../0734.Sentence Similarity/README.md | 8 ++++
.../0734.Sentence Similarity/README_EN.md | 8 ++++
.../0735.Asteroid Collision/README.md | 12 +++++
.../0735.Asteroid Collision/README_EN.md | 12 +++++
.../0736.Parse Lisp Expression/README.md | 8 ++++
.../0736.Parse Lisp Expression/README_EN.md | 8 ++++
.../0737.Sentence Similarity II/README.md | 8 ++++
.../0737.Sentence Similarity II/README_EN.md | 8 ++++
.../0738.Monotone Increasing Digits/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0739.Daily Temperatures/README.md | 22 ++++++++++
.../0739.Daily Temperatures/README_EN.md | 22 ++++++++++
.../0700-0799/0740.Delete and Earn/README.md | 8 ++++
.../0740.Delete and Earn/README_EN.md | 8 ++++
.../0700-0799/0741.Cherry Pickup/README.md | 12 +++++
.../0700-0799/0741.Cherry Pickup/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0743.Network Delay Time/README.md | 32 ++++++++++++++
.../0743.Network Delay Time/README_EN.md | 32 ++++++++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0745.Prefix and Suffix Search/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0746.Min Cost Climbing Stairs/README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0748.Shortest Completing Word/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0700-0799/0749.Contain Virus/README.md | 8 ++++
.../0700-0799/0749.Contain Virus/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
solution/0700-0799/0751.IP to CIDR/README.md | 8 ++++
.../0700-0799/0751.IP to CIDR/README_EN.md | 8 ++++
.../0700-0799/0752.Open the Lock/README.md | 22 ++++++++++
.../0700-0799/0752.Open the Lock/README_EN.md | 22 ++++++++++
.../0753.Cracking the Safe/README.md | 8 ++++
.../0753.Cracking the Safe/README_EN.md | 8 ++++
.../0700-0799/0754.Reach a Number/README.md | 10 +++++
.../0754.Reach a Number/README_EN.md | 10 +++++
solution/0700-0799/0755.Pour Water/README.md | 8 ++++
.../0700-0799/0755.Pour Water/README_EN.md | 8 ++++
.../0756.Pyramid Transition Matrix/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0758.Bold Words in String/README.md | 8 ++++
.../0758.Bold Words in String/README_EN.md | 8 ++++
.../0759.Employee Free Time/README.md | 8 ++++
.../0759.Employee Free Time/README_EN.md | 8 ++++
.../0760.Find Anagram Mappings/README.md | 4 ++
.../0760.Find Anagram Mappings/README_EN.md | 4 ++
.../0761.Special Binary String/README.md | 8 ++++
.../0761.Special Binary String/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0700-0799/0763.Partition Labels/README.md | 16 +++++++
.../0763.Partition Labels/README_EN.md | 16 +++++++
.../0764.Largest Plus Sign/README.md | 8 ++++
.../0764.Largest Plus Sign/README_EN.md | 8 ++++
.../0765.Couples Holding Hands/README.md | 12 +++++
.../0765.Couples Holding Hands/README_EN.md | 12 +++++
.../0700-0799/0766.Toeplitz Matrix/README.md | 10 +++++
.../0766.Toeplitz Matrix/README_EN.md | 10 +++++
.../0767.Reorganize String/README.md | 18 ++++++++
.../0767.Reorganize String/README_EN.md | 18 ++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0769.Max Chunks To Make Sorted/README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../0770.Basic Calculator IV/README.md | 8 ++++
.../0770.Basic Calculator IV/README_EN.md | 8 ++++
.../0771.Jewels and Stones/README.md | 16 +++++++
.../0771.Jewels and Stones/README_EN.md | 16 +++++++
.../0772.Basic Calculator III/README.md | 8 ++++
.../0772.Basic Calculator III/README_EN.md | 8 ++++
.../0700-0799/0773.Sliding Puzzle/README.md | 12 +++++
.../0773.Sliding Puzzle/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
solution/0700-0799/0776.Split BST/README.md | 10 +++++
.../0700-0799/0776.Split BST/README_EN.md | 10 +++++
.../0777.Swap Adjacent in LR String/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0778.Swim in Rising Water/README.md | 12 +++++
.../0778.Swim in Rising Water/README_EN.md | 12 +++++
.../0779.K-th Symbol in Grammar/README.md | 16 +++++++
.../0779.K-th Symbol in Grammar/README_EN.md | 16 +++++++
.../0700-0799/0780.Reaching Points/README.md | 8 ++++
.../0780.Reaching Points/README_EN.md | 8 ++++
.../0781.Rabbits in Forest/README.md | 4 ++
.../0781.Rabbits in Forest/README_EN.md | 4 ++
.../0782.Transform to Chessboard/README.md | 8 ++++
.../0782.Transform to Chessboard/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0784.Letter Case Permutation/README.md | 20 +++++++++
.../0784.Letter Case Permutation/README_EN.md | 20 +++++++++
.../0785.Is Graph Bipartite/README.md | 24 ++++++++++
.../0785.Is Graph Bipartite/README_EN.md | 24 ++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0700-0799/0788.Rotated Digits/README.md | 16 +++++++
.../0788.Rotated Digits/README_EN.md | 16 +++++++
.../0789.Escape The Ghosts/README.md | 10 +++++
.../0789.Escape The Ghosts/README_EN.md | 10 +++++
.../0790.Domino and Tromino Tiling/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0791.Custom Sort String/README.md | 24 ++++++++++
.../0791.Custom Sort String/README_EN.md | 24 ++++++++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0794.Valid Tic-Tac-Toe State/README.md | 10 +++++
.../0794.Valid Tic-Tac-Toe State/README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0700-0799/0796.Rotate String/README.md | 14 ++++++
.../0700-0799/0796.Rotate String/README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0700-0799/0799.Champagne Tower/README.md | 20 +++++++++
.../0799.Champagne Tower/README_EN.md | 20 +++++++++
.../0800.Similar RGB Color/README.md | 6 +++
.../0800.Similar RGB Color/README_EN.md | 6 +++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0802.Find Eventual Safe States/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0803.Bricks Falling When Hit/README.md | 8 ++++
.../0803.Bricks Falling When Hit/README_EN.md | 8 ++++
.../0804.Unique Morse Code Words/README.md | 12 +++++
.../0804.Unique Morse Code Words/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0800-0899/0808.Soup Servings/README.md | 10 +++++
.../0800-0899/0808.Soup Servings/README_EN.md | 10 +++++
.../0800-0899/0809.Expressive Words/README.md | 8 ++++
.../0809.Expressive Words/README_EN.md | 8 ++++
.../0810.Chalkboard XOR Game/README.md | 8 ++++
.../0810.Chalkboard XOR Game/README_EN.md | 8 ++++
.../0811.Subdomain Visit Count/README.md | 8 ++++
.../0811.Subdomain Visit Count/README_EN.md | 8 ++++
.../0812.Largest Triangle Area/README.md | 8 ++++
.../0812.Largest Triangle Area/README_EN.md | 8 ++++
.../0813.Largest Sum of Averages/README.md | 8 ++++
.../0813.Largest Sum of Averages/README_EN.md | 8 ++++
.../0814.Binary Tree Pruning/README.md | 14 ++++++
.../0814.Binary Tree Pruning/README_EN.md | 14 ++++++
solution/0800-0899/0815.Bus Routes/README.md | 10 +++++
.../0800-0899/0815.Bus Routes/README_EN.md | 10 +++++
.../0816.Ambiguous Coordinates/README.md | 10 +++++
.../0816.Ambiguous Coordinates/README_EN.md | 10 +++++
.../0817.Linked List Components/README.md | 14 ++++++
.../0817.Linked List Components/README_EN.md | 14 ++++++
solution/0800-0899/0818.Race Car/README.md | 8 ++++
solution/0800-0899/0818.Race Car/README_EN.md | 8 ++++
.../0800-0899/0819.Most Common Word/README.md | 12 +++++
.../0819.Most Common Word/README_EN.md | 12 +++++
.../0820.Short Encoding of Words/README.md | 16 +++++++
.../0820.Short Encoding of Words/README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0822.Card Flipping Game/README.md | 12 +++++
.../0822.Card Flipping Game/README_EN.md | 12 +++++
.../0823.Binary Trees With Factors/README.md | 10 +++++
.../README_EN.md | 10 +++++
solution/0800-0899/0824.Goat Latin/README.md | 8 ++++
.../0800-0899/0824.Goat Latin/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0826.Most Profit Assigning Work/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0827.Making A Large Island/README.md | 20 +++++++++
.../0827.Making A Large Island/README_EN.md | 20 +++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0829.Consecutive Numbers Sum/README.md | 8 ++++
.../0829.Consecutive Numbers Sum/README_EN.md | 8 ++++
.../0830.Positions of Large Groups/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0832.Flipping an Image/README.md | 10 +++++
.../0832.Flipping an Image/README_EN.md | 10 +++++
.../0833.Find And Replace in String/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0834.Sum of Distances in Tree/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0800-0899/0835.Image Overlap/README.md | 10 +++++
.../0800-0899/0835.Image Overlap/README_EN.md | 10 +++++
.../0836.Rectangle Overlap/README.md | 8 ++++
.../0836.Rectangle Overlap/README_EN.md | 8 ++++
solution/0800-0899/0837.New 21 Game/README.md | 20 +++++++++
.../0800-0899/0837.New 21 Game/README_EN.md | 20 +++++++++
.../0800-0899/0838.Push Dominoes/README.md | 10 +++++
.../0800-0899/0838.Push Dominoes/README_EN.md | 10 +++++
.../0839.Similar String Groups/README.md | 8 ++++
.../0839.Similar String Groups/README_EN.md | 8 ++++
.../0840.Magic Squares In Grid/README.md | 10 +++++
.../0840.Magic Squares In Grid/README_EN.md | 10 +++++
.../0800-0899/0841.Keys and Rooms/README.md | 12 +++++
.../0841.Keys and Rooms/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0800-0899/0843.Guess the Word/README.md | 8 ++++
.../0843.Guess the Word/README_EN.md | 8 ++++
.../0844.Backspace String Compare/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0845.Longest Mountain in Array/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../0846.Hand of Straights/README.md | 16 +++++++
.../0846.Hand of Straights/README_EN.md | 16 +++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../0800-0899/0848.Shifting Letters/README.md | 10 +++++
.../0848.Shifting Letters/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0850.Rectangle Area II/README.md | 8 ++++
.../0850.Rectangle Area II/README_EN.md | 8 ++++
.../0800-0899/0851.Loud and Rich/README.md | 10 +++++
.../0800-0899/0851.Loud and Rich/README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
solution/0800-0899/0853.Car Fleet/README.md | 10 +++++
.../0800-0899/0853.Car Fleet/README_EN.md | 10 +++++
.../0854.K-Similar Strings/README.md | 16 +++++++
.../0854.K-Similar Strings/README_EN.md | 16 +++++++
solution/0800-0899/0855.Exam Room/README.md | 8 ++++
.../0800-0899/0855.Exam Room/README_EN.md | 8 ++++
.../0856.Score of Parentheses/README.md | 8 ++++
.../0856.Score of Parentheses/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0858.Mirror Reflection/README.md | 10 +++++
.../0858.Mirror Reflection/README_EN.md | 10 +++++
.../0800-0899/0859.Buddy Strings/README.md | 10 +++++
.../0800-0899/0859.Buddy Strings/README_EN.md | 10 +++++
.../0800-0899/0860.Lemonade Change/README.md | 12 +++++
.../0860.Lemonade Change/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0800-0899/0866.Prime Palindrome/README.md | 8 ++++
.../0866.Prime Palindrome/README_EN.md | 8 ++++
.../0800-0899/0867.Transpose Matrix/README.md | 10 +++++
.../0867.Transpose Matrix/README_EN.md | 10 +++++
solution/0800-0899/0868.Binary Gap/README.md | 12 +++++
.../0800-0899/0868.Binary Gap/README_EN.md | 12 +++++
.../0869.Reordered Power of 2/README.md | 8 ++++
.../0869.Reordered Power of 2/README_EN.md | 8 ++++
.../0870.Advantage Shuffle/README.md | 12 +++++
.../0870.Advantage Shuffle/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0872.Leaf-Similar Trees/README.md | 12 +++++
.../0872.Leaf-Similar Trees/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0874.Walking Robot Simulation/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0875.Koko Eating Bananas/README.md | 14 ++++++
.../0875.Koko Eating Bananas/README_EN.md | 14 ++++++
.../0876.Middle of the Linked List/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
solution/0800-0899/0877.Stone Game/README.md | 20 +++++++++
.../0800-0899/0877.Stone Game/README_EN.md | 20 +++++++++
.../0878.Nth Magical Number/README.md | 8 ++++
.../0878.Nth Magical Number/README_EN.md | 8 ++++
.../0879.Profitable Schemes/README.md | 16 +++++++
.../0879.Profitable Schemes/README_EN.md | 16 +++++++
.../0880.Decoded String at Index/README.md | 10 +++++
.../0880.Decoded String at Index/README_EN.md | 10 +++++
.../0881.Boats to Save People/README.md | 10 +++++
.../0881.Boats to Save People/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0885.Spiral Matrix III/README.md | 8 ++++
.../0885.Spiral Matrix III/README_EN.md | 8 ++++
.../0886.Possible Bipartition/README.md | 20 +++++++++
.../0886.Possible Bipartition/README_EN.md | 20 +++++++++
.../0800-0899/0887.Super Egg Drop/README.md | 20 +++++++++
.../0887.Super Egg Drop/README_EN.md | 20 +++++++++
.../0800-0899/0888.Fair Candy Swap/README.md | 8 ++++
.../0888.Fair Candy Swap/README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0890.Find and Replace Pattern/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0891.Sum of Subsequence Widths/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0892.Surface Area of 3D Shapes/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0895.Maximum Frequency Stack/README.md | 16 +++++++
.../0895.Maximum Frequency Stack/README_EN.md | 16 +++++++
.../0800-0899/0896.Monotonic Array/README.md | 14 ++++++
.../0896.Monotonic Array/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0898.Bitwise ORs of Subarrays/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0800-0899/0899.Orderly Queue/README.md | 10 +++++
.../0800-0899/0899.Orderly Queue/README_EN.md | 10 +++++
.../0900-0999/0900.RLE Iterator/README.md | 10 +++++
.../0900-0999/0900.RLE Iterator/README_EN.md | 10 +++++
.../0901.Online Stock Span/README.md | 12 +++++
.../0901.Online Stock Span/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../0904.Fruit Into Baskets/README.md | 24 ++++++++++
.../0904.Fruit Into Baskets/README_EN.md | 24 ++++++++++
.../0905.Sort Array By Parity/README.md | 14 ++++++
.../0905.Sort Array By Parity/README_EN.md | 14 ++++++
.../0906.Super Palindromes/README.md | 10 +++++
.../0906.Super Palindromes/README_EN.md | 10 +++++
.../0907.Sum of Subarray Minimums/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0900-0999/0908.Smallest Range I/README.md | 12 +++++
.../0908.Smallest Range I/README_EN.md | 12 +++++
.../0909.Snakes and Ladders/README.md | 8 ++++
.../0909.Snakes and Ladders/README_EN.md | 8 ++++
.../0910.Smallest Range II/README.md | 10 +++++
.../0910.Smallest Range II/README_EN.md | 10 +++++
.../0900-0999/0911.Online Election/README.md | 10 +++++
.../0911.Online Election/README_EN.md | 10 +++++
.../0900-0999/0912.Sort an Array/README.md | 26 +++++++++++
.../0900-0999/0912.Sort an Array/README_EN.md | 26 +++++++++++
.../0900-0999/0913.Cat and Mouse/README.md | 8 ++++
.../0900-0999/0913.Cat and Mouse/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0900-0999/0916.Word Subsets/README.md | 8 ++++
.../0900-0999/0916.Word Subsets/README_EN.md | 8 ++++
.../0917.Reverse Only Letters/README.md | 12 +++++
.../0917.Reverse Only Letters/README_EN.md | 12 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0920.Number of Music Playlists/README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0922.Sort Array By Parity II/README.md | 12 +++++
.../0922.Sort Array By Parity II/README_EN.md | 12 +++++
.../0923.3Sum With Multiplicity/README.md | 10 +++++
.../0923.3Sum With Multiplicity/README_EN.md | 10 +++++
.../0924.Minimize Malware Spread/README.md | 10 +++++
.../0924.Minimize Malware Spread/README_EN.md | 10 +++++
.../0925.Long Pressed Name/README.md | 8 ++++
.../0925.Long Pressed Name/README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0927.Three Equal Parts/README.md | 10 +++++
.../0927.Three Equal Parts/README_EN.md | 10 +++++
.../0928.Minimize Malware Spread II/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0929.Unique Email Addresses/README.md | 14 ++++++
.../0929.Unique Email Addresses/README_EN.md | 14 ++++++
.../0930.Binary Subarrays With Sum/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../0931.Minimum Falling Path Sum/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0900-0999/0932.Beautiful Array/README.md | 8 ++++
.../0932.Beautiful Array/README_EN.md | 8 ++++
.../0933.Number of Recent Calls/README.md | 22 ++++++++++
.../0933.Number of Recent Calls/README_EN.md | 22 ++++++++++
.../0900-0999/0934.Shortest Bridge/README.md | 8 ++++
.../0934.Shortest Bridge/README_EN.md | 8 ++++
.../0900-0999/0935.Knight Dialer/README.md | 12 +++++
.../0900-0999/0935.Knight Dialer/README_EN.md | 12 +++++
.../0936.Stamping The Sequence/README.md | 12 +++++
.../0936.Stamping The Sequence/README_EN.md | 12 +++++
.../0937.Reorder Data in Log Files/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0900-0999/0938.Range Sum of BST/README.md | 12 +++++
.../0938.Range Sum of BST/README_EN.md | 12 +++++
.../0939.Minimum Area Rectangle/README.md | 8 ++++
.../0939.Minimum Area Rectangle/README_EN.md | 8 ++++
.../0940.Distinct Subsequences II/README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../0941.Valid Mountain Array/README.md | 10 +++++
.../0941.Valid Mountain Array/README_EN.md | 10 +++++
.../0900-0999/0942.DI String Match/README.md | 12 +++++
.../0942.DI String Match/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0946.Validate Stack Sequences/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0900-0999/0948.Bag of Tokens/README.md | 8 ++++
.../0900-0999/0948.Bag of Tokens/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0954.Array of Doubled Pairs/README.md | 8 ++++
.../0954.Array of Doubled Pairs/README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../0956.Tallest Billboard/README.md | 18 ++++++++
.../0956.Tallest Billboard/README_EN.md | 18 ++++++++
.../0957.Prison Cells After N Days/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0959.Regions Cut By Slashes/README.md | 8 ++++
.../0959.Regions Cut By Slashes/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0962.Maximum Width Ramp/README.md | 8 ++++
.../0962.Maximum Width Ramp/README_EN.md | 8 ++++
.../0963.Minimum Area Rectangle II/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0965.Univalued Binary Tree/README.md | 12 +++++
.../0965.Univalued Binary Tree/README_EN.md | 12 +++++
.../0966.Vowel Spellchecker/README.md | 8 ++++
.../0966.Vowel Spellchecker/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0968.Binary Tree Cameras/README.md | 10 +++++
.../0968.Binary Tree Cameras/README_EN.md | 10 +++++
.../0900-0999/0969.Pancake Sorting/README.md | 12 +++++
.../0969.Pancake Sorting/README_EN.md | 12 +++++
.../0970.Powerful Integers/README.md | 12 +++++
.../0970.Powerful Integers/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0972.Equal Rational Numbers/README.md | 8 ++++
.../0972.Equal Rational Numbers/README_EN.md | 8 ++++
.../0973.K Closest Points to Origin/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0900-0999/0975.Odd Even Jump/README.md | 8 ++++
.../0900-0999/0975.Odd Even Jump/README_EN.md | 8 ++++
.../0976.Largest Perimeter Triangle/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0977.Squares of a Sorted Array/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../0978.Longest Turbulent Subarray/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0900-0999/0980.Unique Paths III/README.md | 10 +++++
.../0980.Unique Paths III/README_EN.md | 10 +++++
.../0981.Time Based Key-Value Store/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0983.Minimum Cost For Tickets/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0984.String Without AAA or BBB/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../0991.Broken Calculator/README.md | 8 ++++
.../0991.Broken Calculator/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0993.Cousins in Binary Tree/README.md | 20 +++++++++
.../0993.Cousins in Binary Tree/README_EN.md | 20 +++++++++
.../0900-0999/0994.Rotting Oranges/README.md | 12 +++++
.../0994.Rotting Oranges/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../0996.Number of Squareful Arrays/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../0997.Find the Town Judge/README.md | 12 +++++
.../0997.Find the Town Judge/README_EN.md | 12 +++++
.../0998.Maximum Binary Tree II/README.md | 24 ++++++++++
.../0998.Maximum Binary Tree II/README_EN.md | 24 ++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1001.Grid Illumination/README.md | 10 +++++
.../1001.Grid Illumination/README_EN.md | 10 +++++
.../1002.Find Common Characters/README.md | 10 +++++
.../1002.Find Common Characters/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1004.Max Consecutive Ones III/README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1000-1099/1006.Clumsy Factorial/README.md | 4 ++
.../1006.Clumsy Factorial/README_EN.md | 4 ++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1014.Best Sightseeing Pair/README.md | 10 +++++
.../1014.Best Sightseeing Pair/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1017.Convert to Base -2/README.md | 14 ++++++
.../1017.Convert to Base -2/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1020.Number of Enclaves/README.md | 30 +++++++++++++
.../1020.Number of Enclaves/README_EN.md | 30 +++++++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1023.Camelcase Matching/README.md | 10 +++++
.../1023.Camelcase Matching/README_EN.md | 10 +++++
.../1000-1099/1024.Video Stitching/README.md | 8 ++++
.../1024.Video Stitching/README_EN.md | 8 ++++
.../1000-1099/1025.Divisor Game/README.md | 10 +++++
.../1000-1099/1025.Divisor Game/README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1029.Two City Scheduling/README.md | 10 +++++
.../1029.Two City Scheduling/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1032.Stream of Characters/README.md | 8 ++++
.../1032.Stream of Characters/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1034.Coloring A Border/README.md | 10 +++++
.../1034.Coloring A Border/README_EN.md | 10 +++++
.../1000-1099/1035.Uncrossed Lines/README.md | 10 +++++
.../1035.Uncrossed Lines/README_EN.md | 10 +++++
.../1036.Escape a Large Maze/README.md | 10 +++++
.../1036.Escape a Large Maze/README_EN.md | 10 +++++
.../1000-1099/1037.Valid Boomerang/README.md | 12 +++++
.../1037.Valid Boomerang/README_EN.md | 12 +++++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1041.Robot Bounded In Circle/README.md | 10 +++++
.../1041.Robot Bounded In Circle/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1046.Last Stone Weight/README.md | 12 +++++
.../1046.Last Stone Weight/README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1048.Longest String Chain/README.md | 14 ++++++
.../1048.Longest String Chain/README_EN.md | 14 ++++++
.../1049.Last Stone Weight II/README.md | 20 +++++++++
.../1049.Last Stone Weight II/README_EN.md | 20 +++++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1000-1099/1051.Height Checker/README.md | 16 +++++++
.../1051.Height Checker/README_EN.md | 16 +++++++
.../1052.Grumpy Bookstore Owner/README.md | 12 +++++
.../1052.Grumpy Bookstore Owner/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1000-1099/1054.Distant Barcodes/README.md | 10 +++++
.../1054.Distant Barcodes/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1000-1099/1056.Confusing Number/README.md | 10 +++++
.../1056.Confusing Number/README_EN.md | 10 +++++
.../1000-1099/1057.Campus Bikes/README.md | 8 ++++
.../1000-1099/1057.Campus Bikes/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1063.Number of Valid Subarrays/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
solution/1000-1099/1064.Fixed Point/README.md | 10 +++++
.../1000-1099/1064.Fixed Point/README_EN.md | 10 +++++
.../1065.Index Pairs of a String/README.md | 10 +++++
.../1065.Index Pairs of a String/README_EN.md | 10 +++++
.../1000-1099/1066.Campus Bikes II/README.md | 10 +++++
.../1066.Campus Bikes II/README_EN.md | 10 +++++
.../1067.Digit Count in Range/README.md | 8 ++++
.../1067.Digit Count in Range/README_EN.md | 8 ++++
.../1068.Product Sales Analysis I/README.md | 2 +
.../README_EN.md | 2 +
.../1069.Product Sales Analysis II/README.md | 2 +
.../README_EN.md | 2 +
.../1070.Product Sales Analysis III/README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1075.Project Employees I/README.md | 2 +
.../1075.Project Employees I/README_EN.md | 2 +
.../1076.Project Employees II/README.md | 4 ++
.../1076.Project Employees II/README_EN.md | 4 ++
.../1077.Project Employees III/README.md | 2 +
.../1077.Project Employees III/README_EN.md | 2 +
.../1078.Occurrences After Bigram/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1079.Letter Tile Possibilities/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1000-1099/1082.Sales Analysis I/README.md | 4 ++
.../1082.Sales Analysis I/README_EN.md | 4 ++
.../1083.Sales Analysis II/README.md | 2 +
.../1083.Sales Analysis II/README_EN.md | 2 +
.../1084.Sales Analysis III/README.md | 2 +
.../1084.Sales Analysis III/README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
solution/1000-1099/1086.High Five/README.md | 10 +++++
.../1000-1099/1086.High Five/README_EN.md | 10 +++++
.../1000-1099/1087.Brace Expansion/README.md | 4 ++
.../1087.Brace Expansion/README_EN.md | 4 ++
.../1088.Confusing Number II/README.md | 10 +++++
.../1088.Confusing Number II/README_EN.md | 10 +++++
.../1000-1099/1089.Duplicate Zeros/README.md | 12 +++++
.../1089.Duplicate Zeros/README_EN.md | 12 +++++
.../1090.Largest Values From Labels/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
solution/1000-1099/1094.Car Pooling/README.md | 16 +++++++
.../1000-1099/1094.Car Pooling/README_EN.md | 16 +++++++
.../1095.Find in Mountain Array/README.md | 12 +++++
.../1095.Find in Mountain Array/README_EN.md | 12 +++++
.../1096.Brace Expansion II/README.md | 10 +++++
.../1096.Brace Expansion II/README_EN.md | 10 +++++
.../1097.Game Play Analysis V/README.md | 2 +
.../1097.Game Play Analysis V/README_EN.md | 2 +
.../1000-1099/1098.Unpopular Books/README.md | 2 +
.../1098.Unpopular Books/README_EN.md | 2 +
.../1099.Two Sum Less Than K/README.md | 18 ++++++++
.../1099.Two Sum Less Than K/README_EN.md | 18 ++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1105.Filling Bookcase Shelves/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1107.New Users Daily Count/README.md | 2 +
.../1107.New Users Daily Count/README_EN.md | 2 +
.../1108.Defanging an IP Address/README.md | 10 +++++
.../1108.Defanging an IP Address/README_EN.md | 10 +++++
.../1109.Corporate Flight Bookings/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../1100-1199/1113.Reported Posts/README.md | 2 +
.../1113.Reported Posts/README_EN.md | 2 +
.../1100-1199/1114.Print in Order/README.md | 10 +++++
.../1114.Print in Order/README_EN.md | 10 +++++
.../1115.Print FooBar Alternately/README.md | 6 +++
.../README_EN.md | 6 +++
.../1116.Print Zero Even Odd/README.md | 6 +++
.../1116.Print Zero Even Odd/README_EN.md | 6 +++
.../1100-1199/1117.Building H2O/README.md | 6 +++
.../1100-1199/1117.Building H2O/README_EN.md | 6 +++
.../1118.Number of Days in a Month/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1120.Maximum Average Subtree/README.md | 8 ++++
.../1120.Maximum Average Subtree/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1122.Relative Sort Array/README.md | 10 +++++
.../1122.Relative Sort Array/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1125.Smallest Sufficient Team/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1126.Active Businesses/README.md | 4 ++
.../1126.Active Businesses/README_EN.md | 4 ++
.../1127.User Purchase Platform/README.md | 2 +
.../1127.User Purchase Platform/README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1132.Reported Posts II/README.md | 2 +
.../1132.Reported Posts II/README_EN.md | 2 +
.../1133.Largest Unique Number/README.md | 12 +++++
.../1133.Largest Unique Number/README_EN.md | 12 +++++
.../1100-1199/1134.Armstrong Number/README.md | 12 +++++
.../1134.Armstrong Number/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1100-1199/1136.Parallel Courses/README.md | 10 +++++
.../1136.Parallel Courses/README_EN.md | 10 +++++
.../1137.N-th Tribonacci Number/README.md | 26 +++++++++++
.../1137.N-th Tribonacci Number/README_EN.md | 26 +++++++++++
.../1138.Alphabet Board Path/README.md | 8 ++++
.../1138.Alphabet Board Path/README_EN.md | 8 ++++
.../1139.Largest 1-Bordered Square/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1100-1199/1140.Stone Game II/README.md | 12 +++++
.../1100-1199/1140.Stone Game II/README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../1143.Longest Common Subsequence/README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1145.Binary Tree Coloring Game/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1100-1199/1146.Snapshot Array/README.md | 10 +++++
.../1146.Snapshot Array/README_EN.md | 10 +++++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../1100-1199/1148.Article Views I/README.md | 2 +
.../1148.Article Views I/README_EN.md | 2 +
.../1100-1199/1149.Article Views II/README.md | 2 +
.../1149.Article Views II/README_EN.md | 2 +
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1100-1199/1154.Day of the Year/README.md | 12 +++++
.../1154.Day of the Year/README_EN.md | 12 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1158.Market Analysis I/README.md | 4 ++
.../1158.Market Analysis I/README_EN.md | 4 ++
.../1159.Market Analysis II/README.md | 2 +
.../1159.Market Analysis II/README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../1165.Single-Row Keyboard/README.md | 10 +++++
.../1165.Single-Row Keyboard/README_EN.md | 10 +++++
.../1166.Design File System/README.md | 10 +++++
.../1166.Design File System/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../1169.Invalid Transactions/README.md | 8 ++++
.../1169.Invalid Transactions/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1172.Dinner Plate Stacks/README.md | 10 +++++
.../1172.Dinner Plate Stacks/README_EN.md | 10 +++++
.../1173.Immediate Food Delivery I/README.md | 2 +
.../README_EN.md | 2 +
.../1174.Immediate Food Delivery II/README.md | 4 ++
.../README_EN.md | 4 ++
.../1175.Prime Arrangements/README.md | 8 ++++
.../1175.Prime Arrangements/README_EN.md | 8 ++++
.../1176.Diet Plan Performance/README.md | 20 +++++++++
.../1176.Diet Plan Performance/README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1179.Reformat Department Table/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../1181.Before and After Puzzle/README.md | 10 +++++
.../1181.Before and After Puzzle/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1183.Maximum Number of Ones/README.md | 10 +++++
.../1183.Maximum Number of Ones/README_EN.md | 10 +++++
.../1184.Distance Between Bus Stops/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1100-1199/1185.Day of the Week/README.md | 14 ++++++
.../1185.Day of the Week/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../1189.Maximum Number of Balloons/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1193.Monthly Transactions I/README.md | 2 +
.../1193.Monthly Transactions I/README_EN.md | 2 +
.../1194.Tournament Winners/README.md | 2 +
.../1194.Tournament Winners/README_EN.md | 2 +
.../1195.Fizz Buzz Multithreaded/README.md | 4 ++
.../1195.Fizz Buzz Multithreaded/README_EN.md | 4 ++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1197.Minimum Knight Moves/README.md | 20 +++++++++
.../1197.Minimum Knight Moves/README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1200-1299/1201.Ugly Number III/README.md | 10 +++++
.../1201.Ugly Number III/README_EN.md | 10 +++++
.../1202.Smallest String With Swaps/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../1205.Monthly Transactions II/README.md | 2 +
.../1205.Monthly Transactions II/README_EN.md | 2 +
.../1200-1299/1206.Design Skiplist/README.md | 8 ++++
.../1206.Design Skiplist/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../1200-1299/1214.Two Sum BSTs/README.md | 10 +++++
.../1200-1299/1214.Two Sum BSTs/README_EN.md | 10 +++++
.../1200-1299/1215.Stepping Numbers/README.md | 10 +++++
.../1215.Stepping Numbers/README_EN.md | 10 +++++
.../1216.Valid Palindrome III/README.md | 12 +++++
.../1216.Valid Palindrome III/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1219.Path with Maximum Gold/README.md | 12 +++++
.../1219.Path with Maximum Gold/README_EN.md | 12 +++++
.../1220.Count Vowels Permutation/README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1223.Dice Roll Simulation/README.md | 16 +++++++
.../1223.Dice Roll Simulation/README_EN.md | 16 +++++++
.../1224.Maximum Equal Frequency/README.md | 10 +++++
.../1224.Maximum Equal Frequency/README_EN.md | 10 +++++
.../1225.Report Contiguous Dates/README.md | 2 +
.../1225.Report Contiguous Dates/README_EN.md | 2 +
.../1226.The Dining Philosophers/README.md | 2 +
.../1226.The Dining Philosophers/README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1229.Meeting Scheduler/README.md | 10 +++++
.../1229.Meeting Scheduler/README_EN.md | 10 +++++
.../1230.Toss Strange Coins/README.md | 20 +++++++++
.../1230.Toss Strange Coins/README_EN.md | 20 +++++++++
.../1200-1299/1231.Divide Chocolate/README.md | 10 +++++
.../1231.Divide Chocolate/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
solution/1200-1299/1236.Web Crawler/README.md | 8 ++++
.../1200-1299/1236.Web Crawler/README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1242.Web Crawler Multithreaded/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1243.Array Transformation/README.md | 8 ++++
.../1243.Array Transformation/README_EN.md | 8 ++++
.../1244.Design A Leaderboard/README.md | 8 ++++
.../1244.Design A Leaderboard/README_EN.md | 8 ++++
.../1200-1299/1245.Tree Diameter/README.md | 8 ++++
.../1200-1299/1245.Tree Diameter/README_EN.md | 8 ++++
.../1246.Palindrome Removal/README.md | 8 ++++
.../1246.Palindrome Removal/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1251.Average Selling Price/README.md | 2 +
.../1251.Average Selling Price/README_EN.md | 2 +
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1254.Number of Closed Islands/README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1200-1299/1256.Encode Number/README.md | 10 +++++
.../1200-1299/1256.Encode Number/README_EN.md | 10 +++++
.../1257.Smallest Common Region/README.md | 8 ++++
.../1257.Smallest Common Region/README_EN.md | 8 ++++
.../1258.Synonymous Sentences/README.md | 8 ++++
.../1258.Synonymous Sentences/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1200-1299/1260.Shift 2D Grid/README.md | 10 +++++
.../1200-1299/1260.Shift 2D Grid/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1264.Page Recommendations/README.md | 4 ++
.../1264.Page Recommendations/README_EN.md | 4 ++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1268.Search Suggestions System/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
solution/1200-1299/1271.Hexspeak/README.md | 8 ++++
solution/1200-1299/1271.Hexspeak/README_EN.md | 8 ++++
.../1200-1299/1272.Remove Interval/README.md | 8 ++++
.../1272.Remove Interval/README_EN.md | 8 ++++
.../1273.Delete Tree Nodes/README.md | 8 ++++
.../1273.Delete Tree Nodes/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../1280.Students and Examinations/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../1286.Iterator for Combination/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1288.Remove Covered Intervals/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../1291.Sequential Digits/README.md | 10 +++++
.../1291.Sequential Digits/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1302.Deepest Leaves Sum/README.md | 24 ++++++++++
.../1302.Deepest Leaves Sum/README_EN.md | 24 ++++++++++
.../1303.Find the Team Size/README.md | 4 ++
.../1303.Find the Team Size/README_EN.md | 4 ++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1300-1399/1306.Jump Game III/README.md | 10 +++++
.../1300-1399/1306.Jump Game III/README_EN.md | 10 +++++
.../1307.Verbal Arithmetic Puzzle/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1310.XOR Queries of a Subarray/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1300-1399/1314.Matrix Block Sum/README.md | 10 +++++
.../1314.Matrix Block Sum/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1316.Distinct Echo Substrings/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1321.Restaurant Growth/README.md | 4 ++
.../1321.Restaurant Growth/README_EN.md | 4 ++
.../1300-1399/1322.Ads Performance/README.md | 2 +
.../1322.Ads Performance/README_EN.md | 2 +
.../1323.Maximum 69 Number/README.md | 16 +++++++
.../1323.Maximum 69 Number/README_EN.md | 16 +++++++
.../1324.Print Words Vertically/README.md | 8 ++++
.../1324.Print Words Vertically/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1328.Break a Palindrome/README.md | 10 +++++
.../1328.Break a Palindrome/README_EN.md | 10 +++++
.../1329.Sort the Matrix Diagonally/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1331.Rank Transform of an Array/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
solution/1300-1399/1340.Jump Game V/README.md | 16 +++++++
.../1300-1399/1340.Jump Game V/README_EN.md | 16 +++++++
.../1300-1399/1341.Movie Rating/README.md | 2 +
.../1300-1399/1341.Movie Rating/README_EN.md | 2 +
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1300-1399/1345.Jump Game IV/README.md | 8 ++++
.../1300-1399/1345.Jump Game IV/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1348.Tweet Counts Per Frequency/README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1355.Activity Participants/README.md | 2 +
.../1355.Activity Participants/README_EN.md | 2 +
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1361.Validate Binary Tree Nodes/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1300-1399/1362.Closest Divisors/README.md | 8 ++++
.../1362.Closest Divisors/README_EN.md | 8 ++++
.../1363.Largest Multiple of Three/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../1366.Rank Teams by Votes/README.md | 8 ++++
.../1366.Rank Teams by Votes/README_EN.md | 8 ++++
.../1367.Linked List in Binary Tree/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1380.Lucky Numbers in a Matrix/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1384.Total Sales Amount by Year/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1386.Cinema Seat Allocation/README.md | 10 +++++
.../1386.Cinema Seat Allocation/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1388.Pizza With 3n Slices/README.md | 10 +++++
.../1388.Pizza With 3n Slices/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1300-1399/1390.Four Divisors/README.md | 10 +++++
.../1300-1399/1390.Four Divisors/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1392.Longest Happy Prefix/README.md | 12 +++++
.../1392.Longest Happy Prefix/README_EN.md | 12 +++++
.../1300-1399/1393.Capital GainLoss/README.md | 2 +
.../1393.Capital GainLoss/README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1395.Count Number of Teams/README.md | 20 +++++++++
.../1395.Count Number of Teams/README_EN.md | 20 +++++++++
.../1396.Design Underground System/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1397.Find All Good Strings/README.md | 8 ++++
.../1397.Find All Good Strings/README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1399.Count Largest Group/README.md | 10 +++++
.../1399.Count Largest Group/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1400-1499/1402.Reducing Dishes/README.md | 10 +++++
.../1402.Reducing Dishes/README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1405.Longest Happy String/README.md | 10 +++++
.../1405.Longest Happy String/README_EN.md | 10 +++++
.../1400-1499/1406.Stone Game III/README.md | 10 +++++
.../1406.Stone Game III/README_EN.md | 10 +++++
.../1400-1499/1407.Top Travellers/README.md | 2 +
.../1407.Top Travellers/README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../1410.HTML Entity Parser/README.md | 12 +++++
.../1410.HTML Entity Parser/README_EN.md | 12 +++++
.../README.md" | 20 +++++++++
.../README_EN.md" | 20 +++++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../1416.Restore The Array/README.md | 8 ++++
.../1416.Restore The Array/README_EN.md | 8 ++++
.../1417.Reformat The String/README.md | 8 ++++
.../1417.Reformat The String/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
solution/1400-1499/1421.NPV Queries/README.md | 2 +
.../1400-1499/1421.NPV Queries/README_EN.md | 2 +
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../1424.Diagonal Traverse II/README.md | 10 +++++
.../1424.Diagonal Traverse II/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1426.Counting Elements/README.md | 16 +++++++
.../1426.Counting Elements/README_EN.md | 16 +++++++
.../1427.Perform String Shifts/README.md | 10 +++++
.../1427.Perform String Shifts/README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1429.First Unique Number/README.md | 12 +++++
.../1429.First Unique Number/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1435.Create a Session Bar Chart/README.md | 2 +
.../README_EN.md | 2 +
.../1400-1499/1436.Destination City/README.md | 16 +++++++
.../1436.Destination City/README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1400-1499/1445.Apples & Oranges/README.md | 2 +
.../1445.Apples & Oranges/README_EN.md | 2 +
.../1446.Consecutive Characters/README.md | 10 +++++
.../1446.Consecutive Characters/README_EN.md | 10 +++++
.../1447.Simplified Fractions/README.md | 12 +++++
.../1447.Simplified Fractions/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1400-1499/1454.Active Users/README.md | 2 +
.../1400-1499/1454.Active Users/README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1400-1499/1459.Rectangles Area/README.md | 2 +
.../1459.Rectangles Area/README_EN.md | 2 +
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../1462.Course Schedule IV/README.md | 20 +++++++++
.../1462.Course Schedule IV/README_EN.md | 20 +++++++++
.../1400-1499/1463.Cherry Pickup II/README.md | 20 +++++++++
.../1463.Cherry Pickup II/README_EN.md | 20 +++++++++
.../README.md | 34 ++++++++++++++
.../README_EN.md | 34 ++++++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1468.Calculate Salaries/README.md | 2 +
.../1468.Calculate Salaries/README_EN.md | 2 +
.../1469.Find All The Lonely Nodes/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1470.Shuffle the Array/README.md | 18 ++++++++
.../1470.Shuffle the Array/README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1472.Design Browser History/README.md | 8 ++++
.../1472.Design Browser History/README_EN.md | 8 ++++
.../1400-1499/1473.Paint House III/README.md | 10 +++++
.../1473.Paint House III/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 36 +++++++++++++++
.../README_EN.md | 36 +++++++++++++++
.../1476.Subrectangle Queries/README.md | 10 +++++
.../1476.Subrectangle Queries/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1478.Allocate Mailboxes/README.md | 8 ++++
.../1478.Allocate Mailboxes/README_EN.md | 8 ++++
.../1479.Sales by Day of the Week/README.md | 2 +
.../README_EN.md | 2 +
.../1480.Running Sum of 1d Array/README.md | 14 ++++++
.../1480.Running Sum of 1d Array/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1486.XOR Operation in an Array/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1487.Making File Names Unique/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1488.Avoid Flood in The City/README.md | 10 +++++
.../1488.Avoid Flood in The City/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1400-1499/1490.Clone N-ary Tree/README.md | 8 ++++
.../1490.Clone N-ary Tree/README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../1492.The kth Factor of n/README.md | 20 +++++++++
.../1492.The kth Factor of n/README_EN.md | 20 +++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../1494.Parallel Courses II/README.md | 8 ++++
.../1494.Parallel Courses II/README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1400-1499/1496.Path Crossing/README.md | 10 +++++
.../1400-1499/1496.Path Crossing/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1499.Max Value of Equation/README.md | 20 +++++++++
.../1499.Max Value of Equation/README_EN.md | 20 +++++++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1506.Find Root of N-Ary Tree/README.md | 10 +++++
.../1506.Find Root of N-Ary Tree/README_EN.md | 10 +++++
.../1500-1599/1507.Reformat Date/README.md | 12 +++++
.../1500-1599/1507.Reformat Date/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1500-1599/1510.Stone Game IV/README.md | 20 +++++++++
.../1500-1599/1510.Stone Game IV/README_EN.md | 20 +++++++++
.../1511.Customer Order Frequency/README.md | 2 +
.../README_EN.md | 2 +
.../1512.Number of Good Pairs/README.md | 30 +++++++++++++
.../1512.Number of Good Pairs/README_EN.md | 30 +++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1500-1599/1518.Water Bottles/README.md | 14 ++++++
.../1500-1599/1518.Water Bottles/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1522.Diameter of N-Ary Tree/README.md | 16 +++++++
.../1522.Diameter of N-Ary Tree/README_EN.md | 16 +++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1527.Patients With a Condition/README.md | 2 +
.../README_EN.md | 2 +
.../1500-1599/1528.Shuffle String/README.md | 10 +++++
.../1528.Shuffle String/README_EN.md | 10 +++++
.../1529.Minimum Suffix Flips/README.md | 8 ++++
.../1529.Minimum Suffix Flips/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1531.String Compression II/README.md | 2 +
.../1531.String Compression II/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1534.Count Good Triplets/README.md | 8 ++++
.../1534.Count Good Triplets/README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1537.Get the Maximum Score/README.md | 10 +++++
.../1537.Get the Maximum Score/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1543.Fix Product Name Format/README.md | 2 +
.../1543.Fix Product Name Format/README_EN.md | 2 +
.../1544.Make The String Great/README.md | 8 ++++
.../1544.Make The String Great/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1550.Three Consecutive Odds/README.md | 12 +++++
.../1550.Three Consecutive Odds/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1555.Bank Account Summary/README.md | 2 +
.../1555.Bank Account Summary/README_EN.md | 2 +
.../1556.Thousand Separator/README.md | 8 ++++
.../1556.Thousand Separator/README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1559.Detect Cycles in 2D Grid/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../1500-1599/1563.Stone Game V/README.md | 8 ++++
.../1500-1599/1563.Stone Game V/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1571.Warehouse Manager/README.md | 2 +
.../1571.Warehouse Manager/README_EN.md | 2 +
.../1572.Matrix Diagonal Sum/README.md | 16 +++++++
.../1572.Matrix Diagonal Sum/README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../1575.Count All Possible Routes/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1583.Count Unhappy Friends/README.md | 8 ++++
.../1583.Count Unhappy Friends/README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1587.Bank Account Summary II/README.md | 2 +
.../1587.Bank Account Summary II/README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1590.Make Sum Divisible by P/README.md | 10 +++++
.../1590.Make Sum Divisible by P/README_EN.md | 10 +++++
.../1591.Strange Printer II/README.md | 8 ++++
.../1591.Strange Printer II/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1598.Crawler Log Folder/README.md | 14 ++++++
.../1598.Crawler Log Folder/README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1600.Throne Inheritance/README.md | 12 +++++
.../1600.Throne Inheritance/README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../1603.Design Parking System/README.md | 16 +++++++
.../1603.Design Parking System/README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1607.Sellers With No Sales/README.md | 2 +
.../1607.Sellers With No Sales/README_EN.md | 2 +
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../1600-1699/1609.Even Odd Tree/README.md | 16 +++++++
.../1600-1699/1609.Even Odd Tree/README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../1613.Find the Missing IDs/README.md | 2 +
.../1613.Find the Missing IDs/README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1615.Maximal Network Rank/README.md | 12 +++++
.../1615.Maximal Network Rank/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1600-1699/1622.Fancy Sequence/README.md | 6 +++
.../1622.Fancy Sequence/README_EN.md | 6 +++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
solution/1600-1699/1629.Slowest Key/README.md | 8 ++++
.../1600-1699/1629.Slowest Key/README_EN.md | 8 ++++
.../1630.Arithmetic Subarrays/README.md | 14 ++++++
.../1630.Arithmetic Subarrays/README_EN.md | 14 ++++++
.../1631.Path With Minimum Effort/README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../1632.Rank Transform of a Matrix/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1635.Hopper Company Queries I/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../1641.Count Sorted Vowel Strings/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1643.Kth Smallest Instructions/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1645.Hopper Company Queries II/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../1651.Hopper Company Queries III/README.md | 2 +
.../README_EN.md | 2 +
.../1600-1699/1652.Defuse the Bomb/README.md | 20 +++++++++
.../1652.Defuse the Bomb/README_EN.md | 20 +++++++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1656.Design an Ordered Stream/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../1659.Maximize Grid Happiness/README.md | 20 +++++++++
.../1659.Maximize Grid Happiness/README_EN.md | 20 +++++++++
.../1660.Correct a Binary Tree/README.md | 8 ++++
.../1660.Correct a Binary Tree/README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1664.Ways to Make a Fair Array/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1667.Fix Names in a Table/README.md | 4 ++
.../1667.Fix Names in a Table/README_EN.md | 4 ++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1672.Richest Customer Wealth/README.md | 18 ++++++++
.../1672.Richest Customer Wealth/README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1678.Goal Parser Interpretation/README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../1679.Max Number of K-Sum Pairs/README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../1681.Minimum Incompatibility/README.md | 14 ++++++
.../1681.Minimum Incompatibility/README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1600-1699/1683.Invalid Tweets/README.md | 2 +
.../1683.Invalid Tweets/README_EN.md | 2 +
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1600-1699/1686.Stone Game VI/README.md | 10 +++++
.../1600-1699/1686.Stone Game VI/README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1600-1699/1690.Stone Game VII/README.md | 20 +++++++++
.../1690.Stone Game VII/README_EN.md | 20 +++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1693.Daily Leads and Partners/README.md | 2 +
.../README_EN.md | 2 +
.../1694.Reformat Phone Number/README.md | 12 +++++
.../1694.Reformat Phone Number/README_EN.md | 12 +++++
.../1695.Maximum Erasure Value/README.md | 20 +++++++++
.../1695.Maximum Erasure Value/README_EN.md | 20 +++++++++
.../1600-1699/1696.Jump Game VI/README.md | 10 +++++
.../1600-1699/1696.Jump Game VI/README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1701.Average Waiting Time/README.md | 10 +++++
.../1701.Average Waiting Time/README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1706.Where Will the Ball Fall/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1708.Largest Subarray Length K/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1710.Maximum Units on a Truck/README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../1700-1799/1711.Count Good Meals/README.md | 16 +++++++
.../1711.Count Good Meals/README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1715.Count Apples and Oranges/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1720.Decode XORed Array/README.md | 8 ++++
.../1720.Decode XORed Array/README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1726.Tuple with Same Product/README.md | 12 +++++
.../1726.Tuple with Same Product/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1700-1799/1728.Cat and Mouse II/README.md | 2 +
.../1728.Cat and Mouse II/README_EN.md | 2 +
.../1729.Find Followers Count/README.md | 2 +
.../1729.Find Followers Count/README_EN.md | 2 +
.../1730.Shortest Path to Get Food/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1732.Find the Highest Altitude/README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1734.Decode XORed Permutation/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1700-1799/1739.Building Boxes/README.md | 8 ++++
.../1739.Building Boxes/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1745.Palindrome Partitioning IV/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1747.Leetflex Banned Accounts/README.md | 2 +
.../README_EN.md | 2 +
.../1748.Sum of Unique Elements/README.md | 24 ++++++++++
.../1748.Sum of Unique Elements/README_EN.md | 24 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1755.Closest Subsequence Sum/README.md | 16 +++++++
.../1755.Closest Subsequence Sum/README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1763.Longest Nice Substring/README.md | 18 ++++++++
.../1763.Longest Nice Substring/README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1765.Map of Highest Peak/README.md | 20 +++++++++
.../1765.Map of Highest Peak/README_EN.md | 20 +++++++++
.../1700-1799/1766.Tree of Coprimes/README.md | 8 ++++
.../1766.Tree of Coprimes/README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1768.Merge Strings Alternately/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1774.Closest Dessert Cost/README.md | 10 +++++
.../1774.Closest Dessert Cost/README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../1700-1799/1776.Car Fleet II/README.md | 8 ++++
.../1700-1799/1776.Car Fleet II/README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../1782.Count Pairs Of Nodes/README.md | 10 +++++
.../1782.Count Pairs Of Nodes/README_EN.md | 10 +++++
.../1783.Grand Slam Titles/README.md | 4 ++
.../1783.Grand Slam Titles/README_EN.md | 4 ++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1791.Find Center of Star Graph/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1792.Maximum Average Pass Ratio/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1795.Rearrange Products Table/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1800-1899/1809.Ad-Free Sessions/README.md | 2 +
.../1809.Ad-Free Sessions/README_EN.md | 2 +
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../1811.Find Interview Candidates/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../1813.Sentence Similarity III/README.md | 10 +++++
.../1813.Sentence Similarity III/README_EN.md | 10 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1816.Truncate Sentence/README.md | 14 ++++++
.../1816.Truncate Sentence/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1824.Minimum Sideway Jumps/README.md | 10 +++++
.../1824.Minimum Sideway Jumps/README_EN.md | 10 +++++
.../1825.Finding MK Average/README.md | 10 +++++
.../1825.Finding MK Average/README_EN.md | 10 +++++
.../1800-1899/1826.Faulty Sensor/README.md | 10 +++++
.../1800-1899/1826.Faulty Sensor/README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1829.Maximum XOR for Each Query/README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../1833.Maximum Ice Cream Bars/README.md | 12 +++++
.../1833.Maximum Ice Cream Bars/README_EN.md | 12 +++++
.../1834.Single-Threaded CPU/README.md | 8 ++++
.../1834.Single-Threaded CPU/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1837.Sum of Digits in Base K/README.md | 16 +++++++
.../1837.Sum of Digits in Base K/README_EN.md | 16 +++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1840.Maximum Building Height/README.md | 8 ++++
.../1840.Maximum Building Height/README_EN.md | 8 ++++
.../1841.League Statistics/README.md | 2 +
.../1841.League Statistics/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1843.Suspicious Bank Accounts/README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1845.Seat Reservation Manager/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1800-1899/1847.Closest Room/README.md | 8 ++++
.../1800-1899/1847.Closest Room/README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../1853.Convert Date Format/README.md | 2 +
.../1853.Convert Date Format/README_EN.md | 2 +
.../1854.Maximum Population Year/README.md | 12 +++++
.../1854.Maximum Population Year/README_EN.md | 12 +++++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1859.Sorting the Sentence/README.md | 14 ++++++
.../1859.Sorting the Sentence/README_EN.md | 14 ++++++
.../1860.Incremental Memory Leak/README.md | 12 +++++
.../1860.Incremental Memory Leak/README_EN.md | 12 +++++
.../1800-1899/1861.Rotating the Box/README.md | 8 ++++
.../1861.Rotating the Box/README_EN.md | 8 ++++
.../1862.Sum of Floored Pairs/README.md | 12 +++++
.../1862.Sum of Floored Pairs/README_EN.md | 12 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1800-1899/1871.Jump Game VII/README.md | 12 +++++
.../1800-1899/1871.Jump Game VII/README_EN.md | 12 +++++
.../1800-1899/1872.Stone Game VIII/README.md | 18 ++++++++
.../1872.Stone Game VIII/README_EN.md | 18 ++++++++
.../1873.Calculate Special Bonus/README.md | 2 +
.../1873.Calculate Special Bonus/README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1885.Count Pairs in Two Arrays/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1890.The Latest Login in 2020/README.md | 2 +
.../README_EN.md | 2 +
.../1800-1899/1891.Cutting Ribbons/README.md | 14 ++++++
.../1891.Cutting Ribbons/README_EN.md | 14 ++++++
.../1892.Page Recommendations II/README.md | 2 +
.../1892.Page Recommendations II/README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1895.Largest Magic Square/README.md | 10 +++++
.../1895.Largest Magic Square/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1901.Find a Peak Element II/README.md | 12 +++++
.../1901.Find a Peak Element II/README_EN.md | 12 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1905.Count Sub Islands/README.md | 12 +++++
.../1905.Count Sub Islands/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1907.Count Salary Categories/README.md | 4 ++
.../1907.Count Salary Categories/README_EN.md | 4 ++
solution/1900-1999/1908.Game of Nim/README.md | 10 +++++
.../1900-1999/1908.Game of Nim/README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../1912.Design Movie Rental System/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1914.Cyclically Rotating a Grid/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1918.Kth Smallest Subarray Sum/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1919.Leetcodify Similar Friends/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../1922.Count Good Numbers/README.md | 8 ++++
.../1922.Count Good Numbers/README_EN.md | 8 ++++
.../1923.Longest Common Subpath/README.md | 4 ++
.../1923.Longest Common Subpath/README_EN.md | 4 ++
.../1924.Erect the Fence II/README.md | 8 ++++
.../1924.Erect the Fence II/README_EN.md | 8 ++++
.../1925.Count Square Sum Triples/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
solution/1900-1999/1927.Sum Game/README.md | 10 +++++
solution/1900-1999/1927.Sum Game/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1929.Concatenation of Array/README.md | 16 +++++++
.../1929.Concatenation of Array/README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1934.Confirmation Rate/README.md | 2 +
.../1934.Confirmation Rate/README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../1943.Describe the Painting/README.md | 6 +++
.../1943.Describe the Painting/README_EN.md | 6 +++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1949.Strong Friendship/README.md | 2 +
.../1949.Strong Friendship/README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../1900-1999/1952.Three Divisors/README.md | 20 +++++++++
.../1952.Three Divisors/README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1958.Check if Move is Legal/README.md | 8 ++++
.../1958.Check if Move is Legal/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1975.Maximum Matrix Sum/README.md | 10 +++++
.../1975.Maximum Matrix Sum/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../1980.Find Unique Binary String/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1993.Operations on Tree/README.md | 10 +++++
.../1993.Operations on Tree/README_EN.md | 10 +++++
.../1994.The Number of Good Subsets/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../1995.Count Special Quadruplets/README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../1998.GCD Sort of an Array/README.md | 8 ++++
.../1998.GCD Sort of an Array/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2000.Reverse Prefix of Word/README.md | 14 ++++++
.../2000.Reverse Prefix of Word/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2008.Maximum Earnings From Taxi/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../2012.Sum of Beauty in the Array/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2000-2099/2013.Detect Squares/README.md | 8 ++++
.../2013.Detect Squares/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
solution/2000-2099/2017.Grid Game/README.md | 10 +++++
.../2000-2099/2017.Grid Game/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2026.Low-Quality Problems/README.md | 2 +
.../2026.Low-Quality Problems/README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2028.Find Missing Observations/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2000-2099/2029.Stone Game IX/README.md | 8 ++++
.../2000-2099/2029.Stone Game IX/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2000-2099/2032.Two Out of Three/README.md | 12 +++++
.../2032.Two Out of Three/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2034.Stock Price Fluctuation/README.md | 8 ++++
.../2034.Stock Price Fluctuation/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../2043.Simple Bank System/README.md | 12 +++++
.../2043.Simple Bank System/README_EN.md | 12 +++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2050.Parallel Courses III/README.md | 10 +++++
.../2050.Parallel Courses III/README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2055.Plates Between Candles/README.md | 8 ++++
.../2055.Plates Between Candles/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2063.Vowels of All Substrings/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2000-2099/2066.Account Balance/README.md | 2 +
.../2066.Account Balance/README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2072.The Winner University/README.md | 2 +
.../2072.The Winner University/README_EN.md | 2 +
.../2073.Time Needed to Buy Tickets/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../2000-2099/2079.Watering Plants/README.md | 14 ++++++
.../2079.Watering Plants/README_EN.md | 14 ++++++
.../2080.Range Frequency Queries/README.md | 10 +++++
.../2080.Range Frequency Queries/README_EN.md | 10 +++++
.../2081.Sum of k-Mirror Numbers/README.md | 2 +
.../2081.Sum of k-Mirror Numbers/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2090.K Radius Subarray Averages/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../2097.Valid Arrangement of Pairs/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2101.Detonate the Maximum Bombs/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2100-2199/2103.Rings and Rods/README.md | 16 +++++++
.../2103.Rings and Rods/README_EN.md | 16 +++++++
.../2104.Sum of Subarray Ranges/README.md | 20 +++++++++
.../2104.Sum of Subarray Ranges/README_EN.md | 20 +++++++++
.../2105.Watering Plants II/README.md | 12 +++++
.../2105.Watering Plants II/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2109.Adding Spaces to a String/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2118.Build the Equation/README.md | 2 +
.../2118.Build the Equation/README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2122.Recover the Original Array/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2126.Destroying Asteroids/README.md | 8 ++++
.../2126.Destroying Asteroids/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2129.Capitalize the Title/README.md | 12 +++++
.../2129.Capitalize the Title/README_EN.md | 12 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2132.Stamping the Grid/README.md | 14 ++++++
.../2132.Stamping the Grid/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2145.Count the Hidden Sequences/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2157.Groups of Strings/README.md | 8 ++++
.../2157.Groups of Strings/README_EN.md | 8 ++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2100-2199/2166.Design Bitset/README.md | 8 ++++
.../2100-2199/2166.Design Bitset/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2172.Maximum AND Sum of Array/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2173.Longest Winning Streak/README.md | 2 +
.../2173.Longest Winning Streak/README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2191.Sort the Jumbled Numbers/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2211.Count Collisions on a Road/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2219.Maximum Sum Score of Array/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2200-2299/2235.Add Two Integers/README.md | 26 +++++++++++
.../2235.Add Two Integers/README_EN.md | 26 +++++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2241.Design an ATM Machine/README.md | 8 ++++
.../2241.Design an ATM Machine/README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2256.Minimum Average Difference/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2258.Escape the Spreading Fire/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2262.Total Appeal of A String/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2266.Count Number of Texts/README.md | 6 +++
.../2266.Count Number of Texts/README_EN.md | 6 +++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2288.Apply Discount to Prices/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../2200-2299/2293.Min Max Game/README.md | 14 ++++++
.../2200-2299/2293.Min Max Game/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2296.Design a Text Editor/README.md | 8 ++++
.../2296.Design a Text Editor/README_EN.md | 8 ++++
.../2200-2299/2297.Jump Game VIII/README.md | 10 +++++
.../2297.Jump Game VIII/README_EN.md | 10 +++++
.../2298.Tasks Count in the Weekend/README.md | 2 +
.../README_EN.md | 2 +
.../2299.Strong Password Checker II/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2300-2399/2306.Naming a Company/README.md | 10 +++++
.../2306.Naming a Company/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2308.Arrange Table by Gender/README.md | 4 ++
.../2308.Arrange Table by Gender/README_EN.md | 4 ++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2312.Selling Pieces of Wood/README.md | 20 +++++++++
.../2312.Selling Pieces of Wood/README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2300-2399/2315.Count Asterisks/README.md | 16 +++++++
.../2315.Count Asterisks/README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2324.Product Sales Analysis IV/README.md | 2 +
.../README_EN.md | 2 +
.../2325.Decode the Message/README.md | 14 ++++++
.../2325.Decode the Message/README_EN.md | 14 ++++++
.../2300-2399/2326.Spiral Matrix IV/README.md | 10 +++++
.../2326.Spiral Matrix IV/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2329.Product Sales Analysis V/README.md | 2 +
.../README_EN.md | 2 +
.../2330.Valid Palindrome IV/README.md | 10 +++++
.../2330.Valid Palindrome IV/README_EN.md | 10 +++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2300-2399/2347.Best Poker Hand/README.md | 14 ++++++
.../2347.Best Poker Hand/README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../2352.Equal Row and Column Pairs/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../2354.Number of Excellent Pairs/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../2360.Longest Cycle in a Graph/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../2362.Generate the Invoice/README.md | 2 +
.../2362.Generate the Invoice/README_EN.md | 2 +
.../2363.Merge Similar Items/README.md | 14 ++++++
.../2363.Merge Similar Items/README_EN.md | 14 ++++++
.../2364.Count Number of Bad Pairs/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2365.Task Scheduler II/README.md | 10 +++++
.../2365.Task Scheduler II/README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../2370.Longest Ideal Subsequence/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2376.Count Special Integers/README.md | 16 +++++++
.../2376.Count Special Integers/README_EN.md | 16 +++++++
.../2377.Sort the Olympic Table/README.md | 2 +
.../2377.Sort the Olympic Table/README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../2381.Shifting Letters II/README.md | 10 +++++
.../2381.Shifting Letters II/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../2384.Largest Palindromic Number/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2386.Find the K-Sum of an Array/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../2394.Employees With Deductions/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2401.Longest Nice Subarray/README.md | 14 ++++++
.../2401.Longest Nice Subarray/README_EN.md | 14 ++++++
.../2402.Meeting Rooms III/README.md | 8 ++++
.../2402.Meeting Rooms III/README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../2404.Most Frequent Even Element/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
solution/2400-2499/2408.Design SQL/README.md | 8 ++++
.../2400-2499/2408.Design SQL/README_EN.md | 8 ++++
.../2409.Count Days Spent Together/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2413.Smallest Even Multiple/README.md | 14 ++++++
.../2413.Smallest Even Multiple/README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2417.Closest Fair Integer/README.md | 8 ++++
.../2417.Closest Fair Integer/README_EN.md | 8 ++++
.../2400-2499/2418.Sort the People/README.md | 22 ++++++++++
.../2418.Sort the People/README_EN.md | 22 ++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2420.Find All Good Indices/README.md | 8 ++++
.../2420.Find All Good Indices/README_EN.md | 8 ++++
.../2421.Number of Good Paths/README.md | 8 ++++
.../2421.Number of Good Paths/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2424.Longest Uploaded Prefix/README.md | 8 ++++
.../2424.Longest Uploaded Prefix/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2427.Number of Common Factors/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2400-2499/2429.Minimize XOR/README.md | 20 +++++++++
.../2400-2499/2429.Minimize XOR/README_EN.md | 20 +++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2439.Minimize Maximum of Array/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2451.Odd String Difference/README.md | 14 ++++++
.../2451.Odd String Difference/README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2453.Destroy Sequential Targets/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2454.Next Greater Element IV/README.md | 8 ++++
.../2454.Next Greater Element IV/README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../2456.Most Popular Video Creator/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 26 +++++++++++
.../README_EN.md | 26 +++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2469.Convert the Temperature/README.md | 14 ++++++
.../2469.Convert the Temperature/README_EN.md | 14 ++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2473.Minimum Cost to Buy Apples/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 36 +++++++++++++++
.../README_EN.md | 36 +++++++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2480.Form a Chemical Bond/README.md | 2 +
.../2480.Form a Chemical Bond/README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2483.Minimum Penalty for a Shop/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2485.Find the Pivot Integer/README.md | 24 ++++++++++
.../2485.Find the Pivot Integer/README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2490.Circular Sentence/README.md | 28 ++++++++++++
.../2490.Circular Sentence/README_EN.md | 28 ++++++++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2400-2499/2498.Frog Jump II/README.md | 8 ++++
.../2400-2499/2498.Frog Jump II/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../2502.Design Memory Allocator/README.md | 16 +++++++
.../2502.Design Memory Allocator/README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2512.Reward Top K Students/README.md | 12 +++++
.../2512.Reward Top K Students/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2500-2599/2514.Count Anagrams/README.md | 10 +++++
.../2514.Count Anagrams/README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2518.Number of Great Partitions/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2527.Find Xor-Beauty of Array/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 28 ++++++++++++
.../README_EN.md | 28 ++++++++++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2532.Time to Cross a Bridge/README.md | 8 ++++
.../2532.Time to Cross a Bridge/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2540.Minimum Common Value/README.md | 16 +++++++
.../2540.Minimum Common Value/README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2542.Maximum Subsequence Score/README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2544.Alternating Digit Sum/README.md | 18 ++++++++
.../2544.Alternating Digit Sum/README_EN.md | 18 ++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2551.Put Marbles in Bags/README.md | 10 +++++
.../2551.Put Marbles in Bags/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../2500-2599/2560.House Robber IV/README.md | 10 +++++
.../2560.House Robber IV/README_EN.md | 10 +++++
.../2561.Rearranging Fruits/README.md | 8 ++++
.../2561.Rearranging Fruits/README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2564.Substring XOR Queries/README.md | 8 ++++
.../2564.Substring XOR Queries/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2568.Minimum Impossible OR/README.md | 10 +++++
.../2568.Minimum Impossible OR/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2573.Find the String with LCP/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2578.Split With Minimum Sum/README.md | 24 ++++++++++
.../2578.Split With Minimum Sum/README_EN.md | 24 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2500-2599/2582.Pass the Pillow/README.md | 24 ++++++++++
.../2582.Pass the Pillow/README_EN.md | 24 ++++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2590.Design a Todo List/README.md | 6 +++
.../2590.Design a Todo List/README_EN.md | 6 +++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2603.Collect Coins in a Tree/README.md | 10 +++++
.../2603.Collect Coins in a Tree/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 34 ++++++++++++++
.../README_EN.md | 34 ++++++++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../2607.Make K-Subarray Sums Equal/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2608.Shortest Cycle in a Graph/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2600-2699/2611.Mice and Cheese/README.md | 20 +++++++++
.../2611.Mice and Cheese/README_EN.md | 20 +++++++++
.../2612.Minimum Reverse Operations/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2600-2699/2613.Beautiful Pairs/README.md | 10 +++++
.../2613.Beautiful Pairs/README_EN.md | 10 +++++
.../2614.Prime In Diagonal/README.md | 10 +++++
.../2614.Prime In Diagonal/README_EN.md | 10 +++++
.../2600-2699/2615.Sum of Distances/README.md | 8 ++++
.../2615.Sum of Distances/README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2619.Array Prototype Last/README.md | 2 +
.../2619.Array Prototype Last/README_EN.md | 2 +
solution/2600-2699/2620.Counter/README.md | 2 +
solution/2600-2699/2620.Counter/README_EN.md | 2 +
solution/2600-2699/2621.Sleep/README.md | 2 +
solution/2600-2699/2621.Sleep/README_EN.md | 2 +
.../2622.Cache With Time Limit/README.md | 2 +
.../2622.Cache With Time Limit/README_EN.md | 2 +
solution/2600-2699/2623.Memoize/README.md | 2 +
solution/2600-2699/2623.Memoize/README_EN.md | 2 +
.../2600-2699/2624.Snail Traversal/README.md | 2 +
.../2624.Snail Traversal/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
solution/2600-2699/2627.Debounce/README.md | 2 +
solution/2600-2699/2627.Debounce/README_EN.md | 2 +
.../2600-2699/2628.JSON Deep Equal/README.md | 2 +
.../2628.JSON Deep Equal/README_EN.md | 2 +
.../2629.Function Composition/README.md | 2 +
.../2629.Function Composition/README_EN.md | 2 +
solution/2600-2699/2630.Memoize II/README.md | 2 +
.../2600-2699/2630.Memoize II/README_EN.md | 2 +
solution/2600-2699/2631.Group By/README.md | 2 +
solution/2600-2699/2631.Group By/README_EN.md | 2 +
solution/2600-2699/2632.Curry/README.md | 2 +
solution/2600-2699/2632.Curry/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../2634.Filter Elements from Array/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../2600-2699/2636.Promise Pool/README.md | 2 +
.../2600-2699/2636.Promise Pool/README_EN.md | 2 +
.../2637.Promise Time Limit/README.md | 2 +
.../2637.Promise Time Limit/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2641.Cousins in Binary Tree II/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2643.Row With Maximum Ones/README.md | 12 +++++
.../2643.Row With Maximum Ones/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2647.Color the Triangle Red/README.md | 10 +++++
.../2647.Color the Triangle Red/README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2649.Nested Array Generator/README.md | 2 +
.../2649.Nested Array Generator/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2600-2699/2652.Sum Multiples/README.md | 26 +++++++++++
.../2600-2699/2652.Sum Multiples/README_EN.md | 26 +++++++++++
.../2653.Sliding Subarray Beauty/README.md | 20 +++++++++
.../2653.Sliding Subarray Beauty/README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2600-2699/2659.Make Array Empty/README.md | 12 +++++
.../2659.Make Array Empty/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md" | 12 +++++
.../README_EN.md" | 12 +++++
solution/2600-2699/2665.Counter II/README.md | 2 +
.../2600-2699/2665.Counter II/README_EN.md | 2 +
.../2666.Allow One Function Call/README.md | 2 +
.../2666.Allow One Function Call/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../2668.Find Latest Salaries/README.md | 2 +
.../2668.Find Latest Salaries/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2671.Frequency Tracker/README.md | 12 +++++
.../2671.Frequency Tracker/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2675.Array of Objects to Matrix/README.md | 2 +
.../README_EN.md | 2 +
solution/2600-2699/2676.Throttle/README.md | 2 +
solution/2600-2699/2676.Throttle/README_EN.md | 2 +
solution/2600-2699/2677.Chunk Array/README.md | 4 ++
.../2600-2699/2677.Chunk Array/README_EN.md | 4 ++
.../2678.Number of Senior Citizens/README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../2600-2699/2679.Sum in a Matrix/README.md | 14 ++++++
.../2679.Sum in a Matrix/README_EN.md | 14 ++++++
solution/2600-2699/2680.Maximum OR/README.md | 12 +++++
.../2600-2699/2680.Maximum OR/README_EN.md | 12 +++++
.../2600-2699/2681.Power of Heroes/README.md | 10 +++++
.../2681.Power of Heroes/README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2683.Neighboring Bitwise XOR/README.md | 12 +++++
.../2683.Neighboring Bitwise XOR/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2687.Bikes Last Time Used/README.md | 2 +
.../2687.Bikes Last Time Used/README_EN.md | 2 +
.../2688.Find Active Users/README.md | 2 +
.../2688.Find Active Users/README_EN.md | 2 +
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2690.Infinite Method Object/README.md | 2 +
.../2690.Infinite Method Object/README_EN.md | 2 +
.../2691.Immutability Helper/README.md | 2 +
.../2691.Immutability Helper/README_EN.md | 2 +
.../2692.Make Object Immutable/README.md | 2 +
.../2692.Make Object Immutable/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../2600-2699/2694.Event Emitter/README.md | 2 +
.../2600-2699/2694.Event Emitter/README_EN.md | 2 +
.../2600-2699/2695.Array Wrapper/README.md | 2 +
.../2600-2699/2695.Array Wrapper/README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2699.Modify Graph Edge Weights/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2704.To Be Or Not To Be/README.md | 4 ++
.../2704.To Be Or Not To Be/README_EN.md | 4 ++
.../2700-2799/2705.Compact Object/README.md | 4 ++
.../2705.Compact Object/README_EN.md | 4 ++
.../2706.Buy Two Chocolates/README.md | 24 ++++++++++
.../2706.Buy Two Chocolates/README_EN.md | 24 ++++++++++
.../README.md | 22 ++++++++++
.../README_EN.md | 22 ++++++++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2715.Timeout Cancellation/README.md | 4 ++
.../2715.Timeout Cancellation/README_EN.md | 4 ++
.../2716.Minimize String Length/README.md | 14 ++++++
.../2716.Minimize String Length/README_EN.md | 14 ++++++
.../2717.Semi-Ordered Permutation/README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2719.Count of Integers/README.md | 10 +++++
.../2719.Count of Integers/README_EN.md | 10 +++++
.../2720.Popularity Percentage/README.md | 2 +
.../2720.Popularity Percentage/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../2722.Join Two Arrays by ID/README.md | 2 +
.../2722.Join Two Arrays by ID/README_EN.md | 2 +
.../2700-2799/2723.Add Two Promises/README.md | 4 ++
.../2723.Add Two Promises/README_EN.md | 4 ++
solution/2700-2799/2724.Sort By/README.md | 2 +
solution/2700-2799/2724.Sort By/README_EN.md | 2 +
.../2725.Interval Cancellation/README.md | 2 +
.../2725.Interval Cancellation/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../2700-2799/2727.Is Object Empty/README.md | 6 +++
.../2727.Is Object Empty/README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2731.Movement of Robots/README.md | 10 +++++
.../2731.Movement of Robots/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2735.Collecting Chocolates/README.md | 12 +++++
.../2735.Collecting Chocolates/README_EN.md | 12 +++++
.../2736.Maximum Sum Queries/README.md | 12 +++++
.../2736.Maximum Sum Queries/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2738.Count Occurrences in Text/README.md | 2 +
.../README_EN.md | 2 +
.../2739.Total Distance Traveled/README.md | 12 +++++
.../2739.Total Distance Traveled/README_EN.md | 12 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2741.Special Permutations/README.md | 8 ++++
.../2741.Special Permutations/README_EN.md | 8 ++++
.../2742.Painting the Walls/README.md | 10 +++++
.../2742.Painting the Walls/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2747.Count Zero Request Servers/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2748.Number of Beautiful Pairs/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2700-2799/2751.Robot Collisions/README.md | 8 ++++
.../2751.Robot Collisions/README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2754.Bind Function to Context/README.md | 2 +
.../README_EN.md | 2 +
.../2755.Deep Merge of Two Objects/README.md | 2 +
.../README_EN.md | 2 +
.../2700-2799/2756.Query Batching/README.md | 2 +
.../2756.Query Batching/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
solution/2700-2799/2758.Next Day/README.md | 2 +
solution/2700-2799/2758.Next Day/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2762.Continuous Subarrays/README.md | 8 ++++
.../2762.Continuous Subarrays/README_EN.md | 8 ++++
.../README.md | 6 +++
.../README_EN.md | 6 +++
.../README.md" | 10 +++++
.../README_EN.md" | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2700-2799/2766.Relocate Marbles/README.md | 10 +++++
.../2766.Relocate Marbles/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2768.Number of Black Blocks/README.md | 10 +++++
.../2768.Number of Black Blocks/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2774.Array Upper Bound/README.md | 4 ++
.../2774.Array Upper Bound/README_EN.md | 4 ++
.../2775.Undefined to Null/README.md | 2 +
.../2775.Undefined to Null/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../2777.Date Range Generator/README.md | 2 +
.../2777.Date Range Generator/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2784.Check if Array is Good/README.md | 12 +++++
.../2784.Check if Array is Good/README_EN.md | 12 +++++
.../2785.Sort Vowels in a String/README.md | 12 +++++
.../2785.Sort Vowels in a String/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2788.Split Strings by Separator/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2793.Status of Flight Tickets/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../2700-2799/2796.Repeat String/README.md | 4 ++
.../2700-2799/2796.Repeat String/README_EN.md | 4 ++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2802.Find The K-th Lucky Number/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2803.Factorial Generator/README.md | 2 +
.../2803.Factorial Generator/README_EN.md | 2 +
.../2804.Array Prototype ForEach/README.md | 2 +
.../2804.Array Prototype ForEach/README_EN.md | 2 +
.../2800-2899/2805.Custom Interval/README.md | 2 +
.../2805.Custom Interval/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../2800-2899/2810.Faulty Keyboard/README.md | 12 +++++
.../2810.Faulty Keyboard/README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2815.Max Pair Sum in an Array/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2800-2899/2820.Election Results/README.md | 2 +
.../2820.Election Results/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../2822.Inversion of Object/README.md | 2 +
.../2822.Inversion of Object/README_EN.md | 2 +
.../2823.Deep Object Filter/README.md | 2 +
.../2823.Deep Object Filter/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2826.Sorting Three Groups/README.md | 12 +++++
.../2826.Sorting Three Groups/README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2833.Furthest Point From Origin/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2837.Total Traveled Distance/README.md | 2 +
.../2837.Total Traveled Distance/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2843.Count Symmetric Integers/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2851.String Transformation/README.md | 6 +++
.../2851.String Transformation/README_EN.md | 6 +++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2854.Rolling Average Steps/README.md | 2 +
.../2854.Rolling Average Steps/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2800-2899/2860.Happy Students/README.md | 10 +++++
.../2860.Happy Students/README_EN.md | 10 +++++
.../2861.Maximum Number of Alloys/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2864.Maximum Odd Binary Number/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2865.Beautiful Towers I/README.md | 20 +++++++++
.../2865.Beautiful Towers I/README_EN.md | 20 +++++++++
.../2866.Beautiful Towers II/README.md | 10 +++++
.../2866.Beautiful Towers II/README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../2800-2899/2868.The Wording Game/README.md | 10 +++++
.../2868.The Wording Game/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
solution/2800-2899/2880.Select Data/README.md | 2 +
.../2800-2899/2880.Select Data/README_EN.md | 2 +
.../2881.Create a New Column/README.md | 2 +
.../2881.Create a New Column/README_EN.md | 2 +
.../2882.Drop Duplicate Rows/README.md | 2 +
.../2882.Drop Duplicate Rows/README_EN.md | 2 +
.../2883.Drop Missing Data/README.md | 2 +
.../2883.Drop Missing Data/README_EN.md | 2 +
.../2800-2899/2884.Modify Columns/README.md | 2 +
.../2884.Modify Columns/README_EN.md | 2 +
.../2800-2899/2885.Rename Columns/README.md | 2 +
.../2885.Rename Columns/README_EN.md | 2 +
.../2800-2899/2886.Change Data Type/README.md | 2 +
.../2886.Change Data Type/README_EN.md | 2 +
.../2887.Fill Missing Data/README.md | 2 +
.../2887.Fill Missing Data/README_EN.md | 2 +
.../2888.Reshape Data Concatenate/README.md | 2 +
.../README_EN.md | 2 +
.../2889.Reshape Data Pivot/README.md | 2 +
.../2889.Reshape Data Pivot/README_EN.md | 2 +
.../2890.Reshape Data Melt/README.md | 2 +
.../2890.Reshape Data Melt/README_EN.md | 2 +
.../2800-2899/2891.Method Chaining/README.md | 2 +
.../2891.Method Chaining/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2895.Minimum Processing Time/README.md | 10 +++++
.../2895.Minimum Processing Time/README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2898.Maximum Linear Stock Score/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2899.Last Visited Integers/README.md | 12 +++++
.../2899.Last Visited Integers/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2906.Construct Product Matrix/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 34 ++++++++++++++
.../README_EN.md | 34 ++++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../2917.Find the K-or of an Array/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../2922.Market Analysis III/README.md | 2 +
.../2922.Market Analysis III/README_EN.md | 2 +
.../2900-2999/2923.Find Champion I/README.md | 10 +++++
.../2923.Find Champion I/README_EN.md | 10 +++++
.../2900-2999/2924.Find Champion II/README.md | 10 +++++
.../2924.Find Champion II/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2932.Maximum Strong Pair XOR I/README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../2933.High-Access Employees/README.md | 10 +++++
.../2933.High-Access Employees/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2935.Maximum Strong Pair XOR II/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../2937.Make Three Strings Equal/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2939.Maximum Xor Product/README.md | 10 +++++
.../2939.Maximum Xor Product/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 30 +++++++++++++
.../README_EN.md | 30 +++++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 24 ++++++++++
.../README_EN.md | 24 ++++++++++
.../2900-2999/2951.Find the Peaks/README.md | 10 +++++
.../2951.Find the Peaks/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2953.Count Complete Substrings/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2974.Minimum Number Game/README.md | 24 ++++++++++
.../2974.Minimum Number Game/README_EN.md | 24 ++++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../2978.Symmetric Coordinates/README.md | 2 +
.../2978.Symmetric Coordinates/README_EN.md | 2 +
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../2985.Calculate Compressed Mean/README.md | 2 +
.../README_EN.md | 2 +
.../2986.Find Third Transaction/README.md | 2 +
.../2986.Find Third Transaction/README_EN.md | 2 +
.../2987.Find Expensive Cities/README.md | 2 +
.../2987.Find Expensive Cities/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../2989.Class Performance/README.md | 2 +
.../2989.Class Performance/README_EN.md | 2 +
solution/2900-2999/2990.Loan Types/README.md | 2 +
.../2900-2999/2990.Loan Types/README_EN.md | 2 +
.../2991.Top Three Wineries/README.md | 2 +
.../2991.Top Three Wineries/README_EN.md | 2 +
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../2993.Friday Purchases I/README.md | 2 +
.../2993.Friday Purchases I/README_EN.md | 2 +
.../2994.Friday Purchases II/README.md | 2 +
.../2994.Friday Purchases II/README_EN.md | 2 +
.../2995.Viewers Turned Streamers/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3019.Number of Changing Keys/README.md | 10 +++++
.../3019.Number of Changing Keys/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../3000-3099/3024.Type of Triangle/README.md | 12 +++++
.../3024.Type of Triangle/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../3026.Maximum Good Subarray Sum/README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../3028.Ant on the Boundary/README.md | 10 +++++
.../3028.Ant on the Boundary/README_EN.md | 10 +++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../3033.Modify the Matrix/README.md | 12 +++++
.../3033.Modify the Matrix/README_EN.md | 12 +++++
.../README.md | 12 +++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 18 ++++++++
.../README_EN.md | 18 ++++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3044.Most Frequent Prime/README.md | 10 +++++
.../3044.Most Frequent Prime/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3000-3099/3046.Split the Array/README.md | 10 +++++
.../3046.Split the Array/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../3000-3099/3052.Maximize Items/README.md | 2 +
.../3052.Maximize Items/README_EN.md | 2 +
.../README.md | 2 +
.../README_EN.md | 2 +
.../3054.Binary Tree Nodes/README.md | 2 +
.../3054.Binary Tree Nodes/README_EN.md | 2 +
.../3055.Top Percentile Fraud/README.md | 2 +
.../3055.Top Percentile Fraud/README_EN.md | 2 +
.../3000-3099/3056.Snaps Analysis/README.md | 4 ++
.../3056.Snaps Analysis/README_EN.md | 4 ++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 4 ++
.../README_EN.md | 4 ++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3063.Linked List Frequency/README.md | 10 +++++
.../3063.Linked List Frequency/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 14 ++++++
.../README_EN.md | 12 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../3087.Find Trending Hashtags/README.md | 4 ++
.../3087.Find Trending Hashtags/README_EN.md | 4 ++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3089.Find Bursty Behavior/README.md | 4 ++
.../3089.Find Bursty Behavior/README_EN.md | 4 ++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3092.Most Frequent IDs/README.md | 8 ++++
.../3092.Most Frequent IDs/README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../3000-3099/3099.Harshad Number/README.md | 10 +++++
.../3099.Harshad Number/README_EN.md | 10 +++++
.../3100-3199/3100.Water Bottles II/README.md | 10 +++++
.../3100.Water Bottles II/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../3103.Find Trending Hashtags II/README.md | 2 +
.../README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3110.Score of a String/README.md | 10 +++++
.../3110.Score of a String/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 20 +++++++++
.../README_EN.md | 20 +++++++++
.../3115.Maximum Prime Difference/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3118.Friday Purchase III/README.md | 2 +
.../3118.Friday Purchase III/README_EN.md | 2 +
.../README.md | 14 ++++++
.../README_EN.md | 14 ++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../3124.Find Longest Calls/README.md | 4 ++
.../3124.Find Longest Calls/README_EN.md | 4 ++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../3126.Server Utilization Time/README.md | 2 +
.../3126.Server Utilization Time/README_EN.md | 2 +
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3100-3199/3128.Right Triangles/README.md | 10 +++++
.../3128.Right Triangles/README_EN.md | 10 +++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 16 +++++++
.../README_EN.md | 16 +++++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3133.Minimum Array End/README.md | 10 +++++
.../3133.Minimum Array End/README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
solution/3100-3199/3136.Valid Word/README.md | 10 +++++
.../3100-3199/3136.Valid Word/README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 2 +
.../README_EN.md | 2 +
.../3141.Maximum Hamming Distances/README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 8 ++++
.../README_EN.md | 8 ++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../README.md | 10 +++++
.../README_EN.md | 10 +++++
.../3150.Invalid Tweets II/README.md | 4 ++
.../3150.Invalid Tweets II/README_EN.md | 4 ++
solution/template.md | 40 +++++++++++++++++
6756 files changed, 76420 insertions(+)
diff --git a/basic/sorting/BubbleSort/README.md b/basic/sorting/BubbleSort/README.md
index 06e09dbaccd4c..667dd32c54e39 100644
--- a/basic/sorting/BubbleSort/README.md
+++ b/basic/sorting/BubbleSort/README.md
@@ -8,6 +8,8 @@
+#### Python3
+
```python
def bubbleSort(arr):
n = len(arr)
@@ -37,6 +39,8 @@ bubbleSort(arr)
print(arr)
```
+#### Java
+
```java
import java.util.Arrays;
@@ -69,6 +73,8 @@ public class BubbleSort {
}
```
+#### C++
+
```cpp
#include
#include
@@ -97,6 +103,8 @@ int main() {
}
```
+#### Go
+
```go
package main
@@ -122,6 +130,8 @@ func main() {
}
```
+#### Rust
+
```rust
fn bubble_sort(nums: &mut Vec) {
let n = nums.len();
@@ -143,6 +153,8 @@ fn main() {
}
```
+#### JavaScript
+
```js
function bubbleSort(inputArr) {
for (let i = inputArr.length - 1; i > 0; i--) {
@@ -168,6 +180,8 @@ const arr = [6, 3, 2, 1, 5];
console.log(bubbleSort(arr));
```
+#### C#
+
```cs
using static System.Console;
namespace Pro;
diff --git a/basic/sorting/HeapSort/README.md b/basic/sorting/HeapSort/README.md
index 5a5922307f51f..62e522c5fa57e 100644
--- a/basic/sorting/HeapSort/README.md
+++ b/basic/sorting/HeapSort/README.md
@@ -73,6 +73,8 @@ for (int i = n / 2; i > 0; --i) {
### **Python3**
+#### Python3
+
```python
n, m = list(map(int, input().split(" ")))
h = [0] + list(map(int, input().split(" ")))
@@ -112,6 +114,8 @@ print(' '.join(list(map(str, res))))
### **Java**
+#### Java
+
```java
import java.util.Scanner;
@@ -167,6 +171,8 @@ public class Main {
### **Rust**
+#### Rust
+
```rust
use std::io;
@@ -232,6 +238,8 @@ fn main() -> io::Result<()> {
### **Go**
+#### Go
+
```go
package main
@@ -294,6 +302,8 @@ func main() {
+#### Python3
+
```python
n, m = list(map(int, input().split(" ")))
h = [0] + list(map(int, input().split(" ")))
@@ -331,6 +341,8 @@ for i in range(m):
print(' '.join(list(map(str, res))))
```
+#### Java
+
```java
import java.util.Scanner;
@@ -384,6 +396,8 @@ public class Main {
}
```
+#### Go
+
```go
package main
@@ -438,6 +452,8 @@ func main() {
}
```
+#### Rust
+
```rust
use std::io;
diff --git a/basic/sorting/InsertionSort/README.md b/basic/sorting/InsertionSort/README.md
index 43f0583e731d2..3f969bf210c4b 100644
--- a/basic/sorting/InsertionSort/README.md
+++ b/basic/sorting/InsertionSort/README.md
@@ -17,6 +17,8 @@
+#### Python3
+
```python
def insertion_sort(array):
for i in range(len(array)):
@@ -34,6 +36,8 @@ array = [10, 17, 50, 7, 30, 24, 27, 45, 15, 5, 36, 21]
print(insertion_sort(array))
```
+#### Java
+
```java
import java.util.Arrays;
@@ -57,6 +61,8 @@ public class InsertionSort {
}
```
+#### C++
+
```cpp
#include
#include
@@ -96,6 +102,8 @@ int main() {
}
```
+#### Go
+
```go
package main
@@ -118,6 +126,8 @@ func main() {
}
```
+#### Rust
+
```rust
fn insertion_sort(nums: &mut Vec) {
let n = nums.len();
@@ -139,6 +149,8 @@ fn main() {
}
```
+#### JavaScript
+
```js
function insertionSort(inputArr) {
let len = inputArr.length;
@@ -158,6 +170,8 @@ let arr = [6, 3, 2, 1, 5];
console.log(insertionSort(arr));
```
+#### C#
+
```cs
using System.Diagnostics;
using static System.Console;
diff --git a/basic/sorting/MergeSort/README.md b/basic/sorting/MergeSort/README.md
index 6d374e821028b..34934e70e4948 100644
--- a/basic/sorting/MergeSort/README.md
+++ b/basic/sorting/MergeSort/README.md
@@ -73,6 +73,8 @@ void mergeSort(int[] nums, int left, int right) {
+#### Python3
+
```python
N = int(input())
nums = list(map(int, input().split()))
@@ -110,6 +112,8 @@ merge_sort(nums, 0, N - 1)
print(' '.join(list(map(str, nums))))
```
+#### Java
+
```java
import java.util.Scanner;
@@ -157,6 +161,8 @@ public class Main {
}
```
+#### C++
+
```cpp
#include
@@ -194,6 +200,8 @@ int main() {
}
```
+#### Go
+
```go
package main
@@ -246,6 +254,8 @@ func main() {
}
```
+#### Rust
+
```rust
use std::io;
@@ -306,6 +316,8 @@ fn main() -> io::Result<()> {
}
```
+#### JavaScript
+
```js
var buf = '';
diff --git a/basic/sorting/QuickSort/README.md b/basic/sorting/QuickSort/README.md
index 0f1be738fb103..e17d4acb80f5a 100644
--- a/basic/sorting/QuickSort/README.md
+++ b/basic/sorting/QuickSort/README.md
@@ -66,6 +66,8 @@ void quickSort(int[] nums, int left, int right) {
+#### Python3
+
```python
N = int(input())
nums = list(map(int, input().split()))
@@ -95,6 +97,8 @@ quick_sort(nums, 0, N - 1)
print(' '.join(list(map(str, nums))))
```
+#### Java
+
```java
import java.util.Scanner;
@@ -135,6 +139,8 @@ public class Main {
}
```
+#### C++
+
```cpp
#include
@@ -169,6 +175,8 @@ int main() {
}
```
+#### Go
+
```go
package main
@@ -217,6 +225,8 @@ func main() {
}
```
+#### Rust
+
```rust
use rand::Rng; // 0.7.2
use std::io;
@@ -271,6 +281,8 @@ fn main() -> io::Result<()> {
}
```
+#### JavaScript
+
```js
var buf = '';
diff --git a/basic/sorting/SelectionSort/README.md b/basic/sorting/SelectionSort/README.md
index 3093e08c33f78..6a5de354b9dfb 100644
--- a/basic/sorting/SelectionSort/README.md
+++ b/basic/sorting/SelectionSort/README.md
@@ -6,6 +6,8 @@
+#### Python3
+
```python
def selection_sort(arr):
n = len(arr)
@@ -22,6 +24,8 @@ selection_sort(arr)
print(arr)
```
+#### Java
+
```java
import java.util.Arrays;
@@ -53,6 +57,8 @@ public class SelectionSort {
}
```
+#### C++
+
```cpp
#include
#include
@@ -91,6 +97,8 @@ int main(void) {
}
```
+#### Go
+
```go
package main
@@ -115,6 +123,8 @@ func main() {
}
```
+#### Rust
+
```rust
fn selection_sort(nums: &mut Vec) {
let n = nums.len();
@@ -138,6 +148,8 @@ fn main() {
}
```
+#### JavaScript
+
```js
function selectionSort(inputArr) {
let len = inputArr.length;
@@ -159,6 +171,8 @@ let arr = [6, 3, 2, 1, 5];
console.log(selectionSort(arr));
```
+#### C#
+
```cs
using static System.Console;
namespace Pro;
diff --git a/basic/sorting/ShellSort/README.md b/basic/sorting/ShellSort/README.md
index 70e890b1d01aa..13f129323f351 100644
--- a/basic/sorting/ShellSort/README.md
+++ b/basic/sorting/ShellSort/README.md
@@ -11,6 +11,8 @@
+#### Java
+
```java
import java.util.Arrays;
@@ -39,6 +41,8 @@ public class ShellSort {
}
```
+#### Go
+
```go
package main
@@ -64,6 +68,8 @@ func main() {
}
```
+#### Rust
+
```rust
fn shell_sort(nums: &mut Vec) {
let n = nums.len();
@@ -89,6 +95,8 @@ fn main() {
}
```
+#### JavaScript
+
```js
function shellSort(arr) {
var len = arr.length;
diff --git a/lcci/01.01.Is Unique/README.md b/lcci/01.01.Is Unique/README.md
index e7ea4011b05db..e8f0aafbf7165 100644
--- a/lcci/01.01.Is Unique/README.md
+++ b/lcci/01.01.Is Unique/README.md
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.01.Is%20Unique/REA
+#### Python3
+
```python
class Solution:
def isUnique(self, astr: str) -> bool:
@@ -62,6 +64,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
public boolean isUnique(String astr) {
@@ -78,6 +82,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -95,6 +101,8 @@ public:
};
```
+#### Go
+
```go
func isUnique(astr string) bool {
mask := 0
@@ -109,6 +117,8 @@ func isUnique(astr string) bool {
}
```
+#### TypeScript
+
```ts
function isUnique(astr: string): boolean {
let mask = 0;
@@ -123,6 +133,8 @@ function isUnique(astr: string): boolean {
}
```
+#### JavaScript
+
```js
/**
* @param {string} astr
@@ -141,6 +153,8 @@ var isUnique = function (astr) {
};
```
+#### Swift
+
```swift
class Solution {
func isUnique(_ astr: String) -> Bool {
diff --git a/lcci/01.01.Is Unique/README_EN.md b/lcci/01.01.Is Unique/README_EN.md
index fa57e84ad5c99..86501a1e6e8e5 100644
--- a/lcci/01.01.Is Unique/README_EN.md
+++ b/lcci/01.01.Is Unique/README_EN.md
@@ -58,6 +58,8 @@ The time complexity is $O(n)$, where $n$ is the length of the string. The space
+#### Python3
+
```python
class Solution:
def isUnique(self, astr: str) -> bool:
@@ -70,6 +72,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
public boolean isUnique(String astr) {
@@ -86,6 +90,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -103,6 +109,8 @@ public:
};
```
+#### Go
+
```go
func isUnique(astr string) bool {
mask := 0
@@ -117,6 +125,8 @@ func isUnique(astr string) bool {
}
```
+#### TypeScript
+
```ts
function isUnique(astr: string): boolean {
let mask = 0;
@@ -131,6 +141,8 @@ function isUnique(astr: string): boolean {
}
```
+#### JavaScript
+
```js
/**
* @param {string} astr
@@ -149,6 +161,8 @@ var isUnique = function (astr) {
};
```
+#### Swift
+
```swift
class Solution {
func isUnique(_ astr: String) -> Bool {
diff --git a/lcci/01.02.Check Permutation/README.md b/lcci/01.02.Check Permutation/README.md
index 551906fa771d7..db958faa9953e 100644
--- a/lcci/01.02.Check Permutation/README.md
+++ b/lcci/01.02.Check Permutation/README.md
@@ -57,12 +57,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.02.Check%20Permuta
+#### Python3
+
```python
class Solution:
def CheckPermutation(self, s1: str, s2: str) -> bool:
return Counter(s1) == Counter(s2)
```
+#### Java
+
```java
class Solution {
public boolean CheckPermutation(String s1, String s2) {
@@ -83,6 +87,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -97,6 +103,8 @@ public:
};
```
+#### Go
+
```go
func CheckPermutation(s1 string, s2 string) bool {
if len(s1) != len(s2) {
@@ -116,6 +124,8 @@ func CheckPermutation(s1 string, s2 string) bool {
}
```
+#### TypeScript
+
```ts
function CheckPermutation(s1: string, s2: string): boolean {
const n = s1.length;
@@ -137,6 +147,8 @@ function CheckPermutation(s1: string, s2: string): boolean {
}
```
+#### Rust
+
```rust
use std::collections::HashMap;
impl Solution {
@@ -158,6 +170,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s1
@@ -183,6 +197,8 @@ var CheckPermutation = function (s1, s2) {
};
```
+#### Swift
+
```swift
class Solution {
func CheckPermutation(_ s1: String, _ s2: String) -> Bool {
@@ -224,12 +240,16 @@ class Solution {
+#### Python3
+
```python
class Solution:
def CheckPermutation(self, s1: str, s2: str) -> bool:
return sorted(s1) == sorted(s2)
```
+#### Java
+
```java
class Solution {
public boolean CheckPermutation(String s1, String s2) {
@@ -242,6 +262,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -253,6 +275,8 @@ public:
};
```
+#### Go
+
```go
func CheckPermutation(s1 string, s2 string) bool {
cs1, cs2 := []byte(s1), []byte(s2)
@@ -262,12 +286,16 @@ func CheckPermutation(s1 string, s2 string) bool {
}
```
+#### TypeScript
+
```ts
function CheckPermutation(s1: string, s2: string): boolean {
return [...s1].sort().join('') === [...s2].sort().join('');
}
```
+#### Rust
+
```rust
impl Solution {
pub fn check_permutation(s1: String, s2: String) -> bool {
diff --git a/lcci/01.02.Check Permutation/README_EN.md b/lcci/01.02.Check Permutation/README_EN.md
index ba48ed6e0530f..c18cd58477e8d 100644
--- a/lcci/01.02.Check Permutation/README_EN.md
+++ b/lcci/01.02.Check Permutation/README_EN.md
@@ -64,12 +64,16 @@ The time complexity is $O(n)$, and the space complexity is $O(C)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def CheckPermutation(self, s1: str, s2: str) -> bool:
return Counter(s1) == Counter(s2)
```
+#### Java
+
```java
class Solution {
public boolean CheckPermutation(String s1, String s2) {
@@ -90,6 +94,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -104,6 +110,8 @@ public:
};
```
+#### Go
+
```go
func CheckPermutation(s1 string, s2 string) bool {
if len(s1) != len(s2) {
@@ -123,6 +131,8 @@ func CheckPermutation(s1 string, s2 string) bool {
}
```
+#### TypeScript
+
```ts
function CheckPermutation(s1: string, s2: string): boolean {
const n = s1.length;
@@ -144,6 +154,8 @@ function CheckPermutation(s1: string, s2: string): boolean {
}
```
+#### Rust
+
```rust
use std::collections::HashMap;
impl Solution {
@@ -165,6 +177,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s1
@@ -190,6 +204,8 @@ var CheckPermutation = function (s1, s2) {
};
```
+#### Swift
+
```swift
class Solution {
func CheckPermutation(_ s1: String, _ s2: String) -> Bool {
@@ -231,12 +247,16 @@ The time complexity is $O(n \times \log n)$, and the space complexity is $O(n)$.
+#### Python3
+
```python
class Solution:
def CheckPermutation(self, s1: str, s2: str) -> bool:
return sorted(s1) == sorted(s2)
```
+#### Java
+
```java
class Solution {
public boolean CheckPermutation(String s1, String s2) {
@@ -249,6 +269,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -260,6 +282,8 @@ public:
};
```
+#### Go
+
```go
func CheckPermutation(s1 string, s2 string) bool {
cs1, cs2 := []byte(s1), []byte(s2)
@@ -269,12 +293,16 @@ func CheckPermutation(s1 string, s2 string) bool {
}
```
+#### TypeScript
+
```ts
function CheckPermutation(s1: string, s2: string): boolean {
return [...s1].sort().join('') === [...s2].sort().join('');
}
```
+#### Rust
+
```rust
impl Solution {
pub fn check_permutation(s1: String, s2: String) -> bool {
diff --git a/lcci/01.03.String to URL/README.md b/lcci/01.03.String to URL/README.md
index 77eecac6625b3..fd68643cbc456 100644
--- a/lcci/01.03.String to URL/README.md
+++ b/lcci/01.03.String to URL/README.md
@@ -48,18 +48,24 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.03.String%20to%20U
+#### Python3
+
```python
class Solution:
def replaceSpaces(self, S: str, length: int) -> str:
return S[:length].replace(' ', '%20')
```
+#### TypeScript
+
```ts
function replaceSpaces(S: string, length: number): string {
return S.slice(0, length).replace(/\s/g, '%20');
}
```
+#### Rust
+
```rust
impl Solution {
pub fn replace_spaces(s: String, length: i32) -> String {
@@ -68,6 +74,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} S
@@ -79,6 +87,8 @@ var replaceSpaces = function (S, length) {
};
```
+#### Swift
+
```swift
class Solution {
func replaceSpaces(_ S: String, _ length: Int) -> String {
@@ -112,12 +122,16 @@ class Solution {
+#### Python3
+
```python
class Solution:
def replaceSpaces(self, S: str, length: int) -> str:
return ''.join(['%20' if c == ' ' else c for c in S[:length]])
```
+#### Java
+
```java
class Solution {
public String replaceSpaces(String S, int length) {
@@ -137,6 +151,8 @@ class Solution {
}
```
+#### Go
+
```go
func replaceSpaces(S string, length int) string {
// return url.PathEscape(S[:length])
@@ -157,6 +173,8 @@ func replaceSpaces(S string, length int) string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn replace_spaces(s: String, length: i32) -> String {
diff --git a/lcci/01.03.String to URL/README_EN.md b/lcci/01.03.String to URL/README_EN.md
index 8ee4782aaaa0a..12c5ecc5fb171 100644
--- a/lcci/01.03.String to URL/README_EN.md
+++ b/lcci/01.03.String to URL/README_EN.md
@@ -62,18 +62,24 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def replaceSpaces(self, S: str, length: int) -> str:
return S[:length].replace(' ', '%20')
```
+#### TypeScript
+
```ts
function replaceSpaces(S: string, length: number): string {
return S.slice(0, length).replace(/\s/g, '%20');
}
```
+#### Rust
+
```rust
impl Solution {
pub fn replace_spaces(s: String, length: i32) -> String {
@@ -82,6 +88,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} S
@@ -93,6 +101,8 @@ var replaceSpaces = function (S, length) {
};
```
+#### Swift
+
```swift
class Solution {
func replaceSpaces(_ S: String, _ length: Int) -> String {
@@ -126,12 +136,16 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def replaceSpaces(self, S: str, length: int) -> str:
return ''.join(['%20' if c == ' ' else c for c in S[:length]])
```
+#### Java
+
```java
class Solution {
public String replaceSpaces(String S, int length) {
@@ -151,6 +165,8 @@ class Solution {
}
```
+#### Go
+
```go
func replaceSpaces(S string, length int) string {
// return url.PathEscape(S[:length])
@@ -171,6 +187,8 @@ func replaceSpaces(S string, length int) string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn replace_spaces(s: String, length: i32) -> String {
diff --git a/lcci/01.04.Palindrome Permutation/README.md b/lcci/01.04.Palindrome Permutation/README.md
index 6a9e36986bb89..689ccb5841266 100644
--- a/lcci/01.04.Palindrome Permutation/README.md
+++ b/lcci/01.04.Palindrome Permutation/README.md
@@ -44,6 +44,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.04.Palindrome%20Pe
+#### Python3
+
```python
class Solution:
def canPermutePalindrome(self, s: str) -> bool:
@@ -51,6 +53,8 @@ class Solution:
return sum(v & 1 for v in cnt.values()) < 2
```
+#### Java
+
```java
class Solution {
public boolean canPermutePalindrome(String s) {
@@ -67,6 +71,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -84,6 +90,8 @@ public:
};
```
+#### Go
+
```go
func canPermutePalindrome(s string) bool {
vis := map[rune]bool{}
@@ -101,6 +109,8 @@ func canPermutePalindrome(s string) bool {
}
```
+#### TypeScript
+
```ts
function canPermutePalindrome(s: string): boolean {
const set = new Set();
@@ -115,6 +125,8 @@ function canPermutePalindrome(s: string): boolean {
}
```
+#### Rust
+
```rust
use std::collections::HashSet;
@@ -133,6 +145,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func canPermutePalindrome(_ s: String) -> Bool {
@@ -167,6 +181,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def canPermutePalindrome(self, s: str) -> bool:
@@ -179,6 +195,8 @@ class Solution:
return len(vis) < 2
```
+#### Java
+
```java
class Solution {
public boolean canPermutePalindrome(String s) {
@@ -194,6 +212,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
diff --git a/lcci/01.04.Palindrome Permutation/README_EN.md b/lcci/01.04.Palindrome Permutation/README_EN.md
index 971b46c4729d5..e942aadc8b522 100644
--- a/lcci/01.04.Palindrome Permutation/README_EN.md
+++ b/lcci/01.04.Palindrome Permutation/README_EN.md
@@ -42,6 +42,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def canPermutePalindrome(self, s: str) -> bool:
@@ -49,6 +51,8 @@ class Solution:
return sum(v & 1 for v in cnt.values()) < 2
```
+#### Java
+
```java
class Solution {
public boolean canPermutePalindrome(String s) {
@@ -65,6 +69,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -82,6 +88,8 @@ public:
};
```
+#### Go
+
```go
func canPermutePalindrome(s string) bool {
vis := map[rune]bool{}
@@ -99,6 +107,8 @@ func canPermutePalindrome(s string) bool {
}
```
+#### TypeScript
+
```ts
function canPermutePalindrome(s: string): boolean {
const set = new Set();
@@ -113,6 +123,8 @@ function canPermutePalindrome(s: string): boolean {
}
```
+#### Rust
+
```rust
use std::collections::HashSet;
@@ -131,6 +143,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func canPermutePalindrome(_ s: String) -> Bool {
@@ -165,6 +179,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def canPermutePalindrome(self, s: str) -> bool:
@@ -177,6 +193,8 @@ class Solution:
return len(vis) < 2
```
+#### Java
+
```java
class Solution {
public boolean canPermutePalindrome(String s) {
@@ -192,6 +210,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
diff --git a/lcci/01.05.One Away/README.md b/lcci/01.05.One Away/README.md
index c3ad2375beca4..471c6c5f9190c 100644
--- a/lcci/01.05.One Away/README.md
+++ b/lcci/01.05.One Away/README.md
@@ -55,6 +55,8 @@ second = "pal"
+#### Python3
+
```python
class Solution:
def oneEditAway(self, first: str, second: str) -> bool:
@@ -75,6 +77,8 @@ class Solution:
return cnt < 2
```
+#### Java
+
```java
class Solution {
public boolean oneEditAway(String first, String second) {
@@ -108,6 +112,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -142,6 +148,8 @@ public:
};
```
+#### Go
+
```go
func oneEditAway(first string, second string) bool {
m, n := len(first), len(second)
@@ -173,6 +181,8 @@ func oneEditAway(first string, second string) bool {
}
```
+#### TypeScript
+
```ts
function oneEditAway(first: string, second: string): boolean {
let m: number = first.length;
@@ -207,6 +217,8 @@ function oneEditAway(first: string, second: string): boolean {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn one_edit_away(first: String, second: String) -> bool {
@@ -236,6 +248,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func oneEditAway(_ first: String, _ second: String) -> Bool {
diff --git a/lcci/01.05.One Away/README_EN.md b/lcci/01.05.One Away/README_EN.md
index c2146280b0bf1..a0703be7fa38b 100644
--- a/lcci/01.05.One Away/README_EN.md
+++ b/lcci/01.05.One Away/README_EN.md
@@ -64,6 +64,8 @@ The time complexity is $O(n)$, where $n$ is the length of the string. The space
+#### Python3
+
```python
class Solution:
def oneEditAway(self, first: str, second: str) -> bool:
@@ -84,6 +86,8 @@ class Solution:
return cnt < 2
```
+#### Java
+
```java
class Solution {
public boolean oneEditAway(String first, String second) {
@@ -117,6 +121,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -151,6 +157,8 @@ public:
};
```
+#### Go
+
```go
func oneEditAway(first string, second string) bool {
m, n := len(first), len(second)
@@ -182,6 +190,8 @@ func oneEditAway(first string, second string) bool {
}
```
+#### TypeScript
+
```ts
function oneEditAway(first: string, second: string): boolean {
let m: number = first.length;
@@ -216,6 +226,8 @@ function oneEditAway(first: string, second: string): boolean {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn one_edit_away(first: String, second: String) -> bool {
@@ -245,6 +257,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func oneEditAway(_ first: String, _ second: String) -> Bool {
diff --git a/lcci/01.06.Compress String/README.md b/lcci/01.06.Compress String/README.md
index 1dd276978100a..829eb7d532a86 100644
--- a/lcci/01.06.Compress String/README.md
+++ b/lcci/01.06.Compress String/README.md
@@ -53,6 +53,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.06.Compress%20Stri
+#### Python3
+
```python
class Solution:
def compressString(self, S: str) -> str:
@@ -60,6 +62,8 @@ class Solution:
return min(S, t, key=len)
```
+#### Python3
+
```python
class Solution:
def compressString(self, S: str) -> str:
@@ -74,6 +78,8 @@ class Solution:
return min(S, "".join(t), key=len)
```
+#### Java
+
```java
class Solution {
public String compressString(String S) {
@@ -93,6 +99,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -113,6 +121,8 @@ public:
};
```
+#### Go
+
```go
func compressString(S string) string {
n := len(S)
@@ -133,6 +143,8 @@ func compressString(S string) string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn compress_string(s: String) -> String {
@@ -160,6 +172,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} S
@@ -180,6 +194,8 @@ var compressString = function (S) {
};
```
+#### Swift
+
```swift
class Solution {
func compressString(_ S: String) -> String {
diff --git a/lcci/01.06.Compress String/README_EN.md b/lcci/01.06.Compress String/README_EN.md
index 47eb8ec2f5b1c..10346e225a81c 100644
--- a/lcci/01.06.Compress String/README_EN.md
+++ b/lcci/01.06.Compress String/README_EN.md
@@ -60,6 +60,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def compressString(self, S: str) -> str:
@@ -67,6 +69,8 @@ class Solution:
return min(S, t, key=len)
```
+#### Python3
+
```python
class Solution:
def compressString(self, S: str) -> str:
@@ -81,6 +85,8 @@ class Solution:
return min(S, "".join(t), key=len)
```
+#### Java
+
```java
class Solution {
public String compressString(String S) {
@@ -100,6 +106,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -120,6 +128,8 @@ public:
};
```
+#### Go
+
```go
func compressString(S string) string {
n := len(S)
@@ -140,6 +150,8 @@ func compressString(S string) string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn compress_string(s: String) -> String {
@@ -167,6 +179,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} S
@@ -187,6 +201,8 @@ var compressString = function (S) {
};
```
+#### Swift
+
```swift
class Solution {
func compressString(_ S: String) -> String {
diff --git a/lcci/01.07.Rotate Matrix/README.md b/lcci/01.07.Rotate Matrix/README.md
index 25bf0ada99dd9..2d6b196c90198 100644
--- a/lcci/01.07.Rotate Matrix/README.md
+++ b/lcci/01.07.Rotate Matrix/README.md
@@ -72,6 +72,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.07.Rotate%20Matrix
+#### Python3
+
```python
class Solution:
def rotate(self, matrix: List[List[int]]) -> None:
@@ -84,6 +86,8 @@ class Solution:
matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]
```
+#### Java
+
```java
class Solution {
public void rotate(int[][] matrix) {
@@ -106,6 +110,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -125,6 +131,8 @@ public:
};
```
+#### Go
+
```go
func rotate(matrix [][]int) {
n := len(matrix)
@@ -141,6 +149,8 @@ func rotate(matrix [][]int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify matrix in-place instead.
@@ -157,6 +167,8 @@ function rotate(matrix: number[][]): void {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn rotate(matrix: &mut Vec>) {
@@ -179,6 +191,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -194,6 +208,8 @@ var rotate = function (matrix) {
};
```
+#### C#
+
```cs
public class Solution {
public void Rotate(int[][] matrix) {
@@ -216,6 +232,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func rotate(_ matrix: inout [[Int]]) {
diff --git a/lcci/01.07.Rotate Matrix/README_EN.md b/lcci/01.07.Rotate Matrix/README_EN.md
index b391c78045e0a..f093f2a013175 100644
--- a/lcci/01.07.Rotate Matrix/README_EN.md
+++ b/lcci/01.07.Rotate Matrix/README_EN.md
@@ -102,6 +102,8 @@ The time complexity is $O(n^2)$, where $n$ is the side length of the matrix. The
+#### Python3
+
```python
class Solution:
def rotate(self, matrix: List[List[int]]) -> None:
@@ -114,6 +116,8 @@ class Solution:
matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]
```
+#### Java
+
```java
class Solution {
public void rotate(int[][] matrix) {
@@ -136,6 +140,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -155,6 +161,8 @@ public:
};
```
+#### Go
+
```go
func rotate(matrix [][]int) {
n := len(matrix)
@@ -171,6 +179,8 @@ func rotate(matrix [][]int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify matrix in-place instead.
@@ -187,6 +197,8 @@ function rotate(matrix: number[][]): void {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn rotate(matrix: &mut Vec>) {
@@ -209,6 +221,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -224,6 +238,8 @@ var rotate = function (matrix) {
};
```
+#### C#
+
```cs
public class Solution {
public void Rotate(int[][] matrix) {
@@ -246,6 +262,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func rotate(_ matrix: inout [[Int]]) {
diff --git a/lcci/01.08.Zero Matrix/README.md b/lcci/01.08.Zero Matrix/README.md
index 3456a29e3a99e..aa718b9f73fc8 100644
--- a/lcci/01.08.Zero Matrix/README.md
+++ b/lcci/01.08.Zero Matrix/README.md
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/01.08.Zero%20Matrix/R
+#### Python3
+
```python
class Solution:
def setZeroes(self, matrix: List[List[int]]) -> None:
@@ -82,6 +84,8 @@ class Solution:
matrix[i][j] = 0
```
+#### Java
+
```java
class Solution {
public void setZeroes(int[][] matrix) {
@@ -107,6 +111,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -133,6 +139,8 @@ public:
};
```
+#### Go
+
```go
func setZeroes(matrix [][]int) {
m, n := len(matrix), len(matrix[0])
@@ -156,6 +164,8 @@ func setZeroes(matrix [][]int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify matrix in-place instead.
@@ -183,6 +193,8 @@ function setZeroes(matrix: number[][]): void {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn set_zeroes(matrix: &mut Vec>) {
@@ -209,6 +221,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -237,6 +251,8 @@ var setZeroes = function (matrix) {
};
```
+#### C
+
```c
void setZeroes(int** matrix, int matrixSize, int* matrixColSize) {
int m = matrixSize;
@@ -265,6 +281,8 @@ void setZeroes(int** matrix, int matrixSize, int* matrixColSize) {
}
```
+#### Swift
+
```swift
class Solution {
func setZeroes(_ matrix: inout [[Int]]) {
@@ -310,6 +328,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def setZeroes(self, matrix: List[List[int]]) -> None:
@@ -332,6 +352,8 @@ class Solution:
matrix[i][0] = 0
```
+#### Java
+
```java
class Solution {
public void setZeroes(int[][] matrix) {
@@ -378,6 +400,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -425,6 +449,8 @@ public:
};
```
+#### Go
+
```go
func setZeroes(matrix [][]int) {
m, n := len(matrix), len(matrix[0])
@@ -468,6 +494,8 @@ func setZeroes(matrix [][]int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify matrix in-place instead.
@@ -517,6 +545,8 @@ function setZeroes(matrix: number[][]): void {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn set_zeroes(matrix: &mut Vec>) {
@@ -571,6 +601,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -615,6 +647,8 @@ var setZeroes = function (matrix) {
};
```
+#### C
+
```c
void setZeroes(int** matrix, int matrixSize, int* matrixColSize) {
int m = matrixSize;
diff --git a/lcci/01.08.Zero Matrix/README_EN.md b/lcci/01.08.Zero Matrix/README_EN.md
index 7ac8c849b05fd..76481ce6b1413 100644
--- a/lcci/01.08.Zero Matrix/README_EN.md
+++ b/lcci/01.08.Zero Matrix/README_EN.md
@@ -94,6 +94,8 @@ The time complexity is $O(m \times n)$, and the space complexity is $O(m + n)$.
+#### Python3
+
```python
class Solution:
def setZeroes(self, matrix: List[List[int]]) -> None:
@@ -110,6 +112,8 @@ class Solution:
matrix[i][j] = 0
```
+#### Java
+
```java
class Solution {
public void setZeroes(int[][] matrix) {
@@ -135,6 +139,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -161,6 +167,8 @@ public:
};
```
+#### Go
+
```go
func setZeroes(matrix [][]int) {
m, n := len(matrix), len(matrix[0])
@@ -184,6 +192,8 @@ func setZeroes(matrix [][]int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify matrix in-place instead.
@@ -211,6 +221,8 @@ function setZeroes(matrix: number[][]): void {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn set_zeroes(matrix: &mut Vec>) {
@@ -237,6 +249,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -265,6 +279,8 @@ var setZeroes = function (matrix) {
};
```
+#### C
+
```c
void setZeroes(int** matrix, int matrixSize, int* matrixColSize) {
int m = matrixSize;
@@ -293,6 +309,8 @@ void setZeroes(int** matrix, int matrixSize, int* matrixColSize) {
}
```
+#### Swift
+
```swift
class Solution {
func setZeroes(_ matrix: inout [[Int]]) {
@@ -338,6 +356,8 @@ The time complexity is $O(m \times n)$, where $m$ and $n$ are the number of rows
+#### Python3
+
```python
class Solution:
def setZeroes(self, matrix: List[List[int]]) -> None:
@@ -360,6 +380,8 @@ class Solution:
matrix[i][0] = 0
```
+#### Java
+
```java
class Solution {
public void setZeroes(int[][] matrix) {
@@ -406,6 +428,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -453,6 +477,8 @@ public:
};
```
+#### Go
+
```go
func setZeroes(matrix [][]int) {
m, n := len(matrix), len(matrix[0])
@@ -496,6 +522,8 @@ func setZeroes(matrix [][]int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify matrix in-place instead.
@@ -545,6 +573,8 @@ function setZeroes(matrix: number[][]): void {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn set_zeroes(matrix: &mut Vec>) {
@@ -599,6 +629,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -643,6 +675,8 @@ var setZeroes = function (matrix) {
};
```
+#### C
+
```c
void setZeroes(int** matrix, int matrixSize, int* matrixColSize) {
int m = matrixSize;
diff --git a/lcci/01.09.String Rotation/README.md b/lcci/01.09.String Rotation/README.md
index 5066593ac0596..94c2dba7267a9 100644
--- a/lcci/01.09.String Rotation/README.md
+++ b/lcci/01.09.String Rotation/README.md
@@ -72,12 +72,16 @@ s1 + s1 = "abaaba"
+#### Python3
+
```python
class Solution:
def isFlipedString(self, s1: str, s2: str) -> bool:
return len(s1) == len(s2) and s2 in s1 * 2
```
+#### Java
+
```java
class Solution {
public boolean isFlipedString(String s1, String s2) {
@@ -86,6 +90,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -95,18 +101,24 @@ public:
};
```
+#### Go
+
```go
func isFlipedString(s1 string, s2 string) bool {
return len(s1) == len(s2) && strings.Contains(s1+s1, s2)
}
```
+#### TypeScript
+
```ts
function isFlipedString(s1: string, s2: string): boolean {
return s1.length === s2.length && (s2 + s2).indexOf(s1) !== -1;
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_fliped_string(s1: String, s2: String) -> bool {
@@ -115,6 +127,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func isFlippedString(_ s1: String, _ s2: String) -> Bool {
diff --git a/lcci/01.09.String Rotation/README_EN.md b/lcci/01.09.String Rotation/README_EN.md
index 142c48d83768b..3989a3824c40a 100644
--- a/lcci/01.09.String Rotation/README_EN.md
+++ b/lcci/01.09.String Rotation/README_EN.md
@@ -73,12 +73,16 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def isFlipedString(self, s1: str, s2: str) -> bool:
return len(s1) == len(s2) and s2 in s1 * 2
```
+#### Java
+
```java
class Solution {
public boolean isFlipedString(String s1, String s2) {
@@ -87,6 +91,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -96,18 +102,24 @@ public:
};
```
+#### Go
+
```go
func isFlipedString(s1 string, s2 string) bool {
return len(s1) == len(s2) && strings.Contains(s1+s1, s2)
}
```
+#### TypeScript
+
```ts
function isFlipedString(s1: string, s2: string): boolean {
return s1.length === s2.length && (s2 + s2).indexOf(s1) !== -1;
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_fliped_string(s1: String, s2: String) -> bool {
@@ -116,6 +128,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func isFlippedString(_ s1: String, _ s2: String) -> Bool {
diff --git a/lcci/02.01.Remove Duplicate Node/README.md b/lcci/02.01.Remove Duplicate Node/README.md
index 456d9aba9f664..2ae25301c15f6 100644
--- a/lcci/02.01.Remove Duplicate Node/README.md
+++ b/lcci/02.01.Remove Duplicate Node/README.md
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/02.01.Remove%20Duplic
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -82,6 +84,8 @@ class Solution:
return head
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -107,6 +111,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -134,6 +140,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -157,6 +165,8 @@ func removeDuplicateNodes(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -185,6 +195,8 @@ function removeDuplicateNodes(head: ListNode | null): ListNode | null {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -224,6 +236,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -251,6 +265,8 @@ var removeDuplicateNodes = function (head) {
};
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
diff --git a/lcci/02.01.Remove Duplicate Node/README_EN.md b/lcci/02.01.Remove Duplicate Node/README_EN.md
index d84864ddd41f5..d155fd3e4e551 100644
--- a/lcci/02.01.Remove Duplicate Node/README_EN.md
+++ b/lcci/02.01.Remove Duplicate Node/README_EN.md
@@ -67,6 +67,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -88,6 +90,8 @@ class Solution:
return head
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -113,6 +117,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -140,6 +146,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -163,6 +171,8 @@ func removeDuplicateNodes(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -191,6 +201,8 @@ function removeDuplicateNodes(head: ListNode | null): ListNode | null {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -230,6 +242,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -257,6 +271,8 @@ var removeDuplicateNodes = function (head) {
};
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
diff --git a/lcci/02.02.Kth Node From End of List/README.md b/lcci/02.02.Kth Node From End of List/README.md
index e010d644aedfb..3d10483e2a0e6 100644
--- a/lcci/02.02.Kth Node From End of List/README.md
+++ b/lcci/02.02.Kth Node From End of List/README.md
@@ -41,6 +41,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/02.02.Kth%20Node%20Fr
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -60,6 +62,8 @@ class Solution:
return slow.val
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -110,6 +116,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -131,6 +139,8 @@ func kthToLast(head *ListNode, k int) int {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -157,6 +167,8 @@ function kthToLast(head: ListNode | null, k: number): number {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -190,6 +202,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -216,6 +230,8 @@ var kthToLast = function (head, k) {
};
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
diff --git a/lcci/02.02.Kth Node From End of List/README_EN.md b/lcci/02.02.Kth Node From End of List/README_EN.md
index 3d7c39ca06ff3..3ad666e90fc46 100644
--- a/lcci/02.02.Kth Node From End of List/README_EN.md
+++ b/lcci/02.02.Kth Node From End of List/README_EN.md
@@ -44,6 +44,8 @@ The time complexity is $O(n)$, where $n$ is the length of the list. The space co
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -63,6 +65,8 @@ class Solution:
return slow.val
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -87,6 +91,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -113,6 +119,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -134,6 +142,8 @@ func kthToLast(head *ListNode, k int) int {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -160,6 +170,8 @@ function kthToLast(head: ListNode | null, k: number): number {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -193,6 +205,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -219,6 +233,8 @@ var kthToLast = function (head, k) {
};
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
diff --git a/lcci/02.03.Delete Middle Node/README.md b/lcci/02.03.Delete Middle Node/README.md
index d3db6133858c0..f364e78673c15 100644
--- a/lcci/02.03.Delete Middle Node/README.md
+++ b/lcci/02.03.Delete Middle Node/README.md
@@ -45,6 +45,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/02.03.Delete%20Middle
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -59,6 +61,8 @@ class Solution:
node.next = node.next.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -76,6 +80,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -94,6 +100,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -108,6 +116,8 @@ func deleteNode(node *ListNode) {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -126,6 +136,8 @@ var deleteNode = function (node) {
};
```
+#### Swift
+
```swift
/**
* public class ListNode {
diff --git a/lcci/02.03.Delete Middle Node/README_EN.md b/lcci/02.03.Delete Middle Node/README_EN.md
index cf247020d12c2..20edd71820a18 100644
--- a/lcci/02.03.Delete Middle Node/README_EN.md
+++ b/lcci/02.03.Delete Middle Node/README_EN.md
@@ -42,6 +42,8 @@ The time complexity is $O(1)$, and the space complexity is $O(1)$.
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -56,6 +58,8 @@ class Solution:
node.next = node.next.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -73,6 +77,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -91,6 +97,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -105,6 +113,8 @@ func deleteNode(node *ListNode) {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -123,6 +133,8 @@ var deleteNode = function (node) {
};
```
+#### Swift
+
```swift
/**
* public class ListNode {
diff --git a/lcci/02.04.Partition List/README.md b/lcci/02.04.Partition List/README.md
index 55ec6cf9cf7e8..0295f353a03a7 100644
--- a/lcci/02.04.Partition List/README.md
+++ b/lcci/02.04.Partition List/README.md
@@ -68,6 +68,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/02.04.Partition%20Lis
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -93,6 +95,8 @@ class Solution:
return left.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -124,6 +128,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -156,6 +162,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -182,6 +190,8 @@ func partition(head *ListNode, x int) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -213,6 +223,8 @@ function partition(head: ListNode | null, x: number): ListNode | null {
}
```
+#### Swift
+
```swift
/** public class ListNode {
* var val: Int
diff --git a/lcci/02.04.Partition List/README_EN.md b/lcci/02.04.Partition List/README_EN.md
index 46a0ba4d366e2..21aaa81ed857d 100644
--- a/lcci/02.04.Partition List/README_EN.md
+++ b/lcci/02.04.Partition List/README_EN.md
@@ -48,6 +48,8 @@ The time complexity is $O(n)$, where $n$ is the length of the list. The space co
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -73,6 +75,8 @@ class Solution:
return left.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -104,6 +108,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -162,6 +170,8 @@ func partition(head *ListNode, x int) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -193,6 +203,8 @@ function partition(head: ListNode | null, x: number): ListNode | null {
}
```
+#### Swift
+
```swift
/** public class ListNode {
* var val: Int
diff --git a/lcci/02.05.Sum Lists/README.md b/lcci/02.05.Sum Lists/README.md
index 6ce8133579ddb..3ce68c29bf90c 100644
--- a/lcci/02.05.Sum Lists/README.md
+++ b/lcci/02.05.Sum Lists/README.md
@@ -54,6 +54,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/02.05.Sum%20Lists/REA
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -76,6 +78,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -103,6 +107,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -131,6 +137,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -160,6 +168,8 @@ func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -204,6 +214,8 @@ function addTwoNumbers(l1: ListNode | null, l2: ListNode | null): ListNode | nul
}
```
+#### Rust
+
```rust
impl Solution {
pub fn add_two_numbers(
@@ -242,6 +254,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -271,6 +285,8 @@ var addTwoNumbers = function (l1, l2) {
};
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
diff --git a/lcci/02.05.Sum Lists/README_EN.md b/lcci/02.05.Sum Lists/README_EN.md
index d535330cc90dd..863acc038358b 100644
--- a/lcci/02.05.Sum Lists/README_EN.md
+++ b/lcci/02.05.Sum Lists/README_EN.md
@@ -58,6 +58,8 @@ The time complexity is $O(\max(m, n))$, where $m$ and $n$ are the lengths of the
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -80,6 +82,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -107,6 +111,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -135,6 +141,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -164,6 +172,8 @@ func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -208,6 +218,8 @@ function addTwoNumbers(l1: ListNode | null, l2: ListNode | null): ListNode | nul
}
```
+#### Rust
+
```rust
impl Solution {
pub fn add_two_numbers(
@@ -246,6 +258,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -275,6 +289,8 @@ var addTwoNumbers = function (l1, l2) {
};
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
diff --git a/lcci/02.06.Palindrome Linked List/README.md b/lcci/02.06.Palindrome Linked List/README.md
index bbbb83137b5b4..7522e99791c51 100644
--- a/lcci/02.06.Palindrome Linked List/README.md
+++ b/lcci/02.06.Palindrome Linked List/README.md
@@ -55,6 +55,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/02.06.Palindrome%20Li
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -86,6 +88,8 @@ class Solution:
return True
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -128,6 +132,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -171,6 +177,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -208,6 +216,8 @@ func isPalindrome(head *ListNode) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -252,6 +262,8 @@ function isPalindrome(head: ListNode | null): boolean {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -295,6 +307,8 @@ var isPalindrome = function (head) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -337,6 +351,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
/**
* public class ListNode {
diff --git a/lcci/02.06.Palindrome Linked List/README_EN.md b/lcci/02.06.Palindrome Linked List/README_EN.md
index 8a8e5a3049283..00baf684a1ef3 100644
--- a/lcci/02.06.Palindrome Linked List/README_EN.md
+++ b/lcci/02.06.Palindrome Linked List/README_EN.md
@@ -64,6 +64,8 @@ The time complexity is $O(n)$, where $n$ is the length of the list. The space co
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -95,6 +97,8 @@ class Solution:
return True
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -137,6 +141,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -180,6 +186,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -217,6 +225,8 @@ func isPalindrome(head *ListNode) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -261,6 +271,8 @@ function isPalindrome(head: ListNode | null): boolean {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -304,6 +316,8 @@ var isPalindrome = function (head) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -346,6 +360,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
/**
* public class ListNode {
diff --git a/lcci/02.07.Intersection of Two Linked Lists/README.md b/lcci/02.07.Intersection of Two Linked Lists/README.md
index 0c523e093da20..b6643ffd26e08 100644
--- a/lcci/02.07.Intersection of Two Linked Lists/README.md
+++ b/lcci/02.07.Intersection of Two Linked Lists/README.md
@@ -34,6 +34,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/02.07.Intersection%20
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -51,6 +53,8 @@ class Solution:
return a
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -75,6 +79,8 @@ public class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -97,6 +103,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -123,6 +131,8 @@ func getIntersectionNode(headA, headB *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -147,6 +157,8 @@ function getIntersectionNode(headA: ListNode | null, headB: ListNode | null): Li
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -172,6 +184,8 @@ var getIntersectionNode = function (headA, headB) {
};
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
diff --git a/lcci/02.07.Intersection of Two Linked Lists/README_EN.md b/lcci/02.07.Intersection of Two Linked Lists/README_EN.md
index f000df44ebe2d..ac315b0efb893 100644
--- a/lcci/02.07.Intersection of Two Linked Lists/README_EN.md
+++ b/lcci/02.07.Intersection of Two Linked Lists/README_EN.md
@@ -73,6 +73,8 @@ The time complexity is $O(m+n)$, where $m$ and $n$ are the lengths of the linked
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -90,6 +92,8 @@ class Solution:
return a
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -114,6 +118,8 @@ public class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -162,6 +170,8 @@ func getIntersectionNode(headA, headB *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -186,6 +196,8 @@ function getIntersectionNode(headA: ListNode | null, headB: ListNode | null): Li
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -211,6 +223,8 @@ var getIntersectionNode = function (headA, headB) {
};
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
diff --git a/lcci/02.08.Linked List Cycle/README_EN.md b/lcci/02.08.Linked List Cycle/README_EN.md
index 18b5ee96f043e..575492b63d0a3 100644
--- a/lcci/02.08.Linked List Cycle/README_EN.md
+++ b/lcci/02.08.Linked List Cycle/README_EN.md
@@ -74,6 +74,8 @@ The time complexity is $O(n)$, where $n$ is the number of nodes in the linked li
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -96,6 +98,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -128,6 +132,8 @@ public class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -159,6 +165,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -185,6 +193,8 @@ func detectCycle(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -216,6 +226,8 @@ function detectCycle(head: ListNode | null): ListNode | null {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -247,6 +259,8 @@ var detectCycle = function (head) {
};
```
+#### Swift
+
```swift
/*
* public class ListNode {
diff --git a/lcci/03.01.Three in One/README.md b/lcci/03.01.Three in One/README.md
index 0f578a1eaae73..e9e9bd2ee6f2c 100644
--- a/lcci/03.01.Three in One/README.md
+++ b/lcci/03.01.Three in One/README.md
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/03.01.Three%20in%20On
+#### Python3
+
```python
class TripleInOne:
@@ -96,6 +98,8 @@ class TripleInOne:
# param_4 = obj.isEmpty(stackNum)
```
+#### Java
+
```java
class TripleInOne {
private int cap;
@@ -140,6 +144,8 @@ class TripleInOne {
*/
```
+#### C++
+
```cpp
class TripleInOne {
public:
@@ -186,6 +192,8 @@ private:
*/
```
+#### Go
+
```go
type TripleInOne struct {
cap int
@@ -232,6 +240,8 @@ func (this *TripleInOne) IsEmpty(stackNum int) bool {
*/
```
+#### TypeScript
+
```ts
class TripleInOne {
private cap: number;
@@ -279,6 +289,8 @@ class TripleInOne {
*/
```
+#### Swift
+
```swift
class TripleInOne {
private var cap: Int
diff --git a/lcci/03.01.Three in One/README_EN.md b/lcci/03.01.Three in One/README_EN.md
index ddaeaf47b4281..61347236f71d8 100644
--- a/lcci/03.01.Three in One/README_EN.md
+++ b/lcci/03.01.Three in One/README_EN.md
@@ -76,6 +76,8 @@ In terms of time complexity, the time complexity of each operation is $O(1)$. Th
+#### Python3
+
```python
class TripleInOne:
@@ -111,6 +113,8 @@ class TripleInOne:
# param_4 = obj.isEmpty(stackNum)
```
+#### Java
+
```java
class TripleInOne {
private int cap;
@@ -155,6 +159,8 @@ class TripleInOne {
*/
```
+#### C++
+
```cpp
class TripleInOne {
public:
@@ -201,6 +207,8 @@ private:
*/
```
+#### Go
+
```go
type TripleInOne struct {
cap int
@@ -247,6 +255,8 @@ func (this *TripleInOne) IsEmpty(stackNum int) bool {
*/
```
+#### TypeScript
+
```ts
class TripleInOne {
private cap: number;
@@ -294,6 +304,8 @@ class TripleInOne {
*/
```
+#### Swift
+
```swift
class TripleInOne {
private var cap: Int
diff --git a/lcci/03.02.Min Stack/README.md b/lcci/03.02.Min Stack/README.md
index fa2bea3f918bd..45a8d74c4e478 100644
--- a/lcci/03.02.Min Stack/README.md
+++ b/lcci/03.02.Min Stack/README.md
@@ -35,6 +35,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/03.02.Min%20Stack/REA
+#### Python3
+
```python
class MinStack:
def __init__(self):
@@ -67,6 +69,8 @@ class MinStack:
# param_4 = obj.getMin()
```
+#### Java
+
```java
class MinStack {
private Deque stk1 = new ArrayDeque<>();
@@ -106,6 +110,8 @@ class MinStack {
*/
```
+#### C++
+
```cpp
class MinStack {
public:
@@ -147,6 +153,8 @@ private:
*/
```
+#### Go
+
```go
type MinStack struct {
stk1 []int
@@ -186,6 +194,8 @@ func (this *MinStack) GetMin() int {
*/
```
+#### TypeScript
+
```ts
class MinStack {
stack: number[];
@@ -224,6 +234,8 @@ class MinStack {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
struct MinStack {
@@ -272,6 +284,8 @@ impl MinStack {
*/
```
+#### C#
+
```cs
public class MinStack {
private Stack stk1 = new Stack();
@@ -311,6 +325,8 @@ public class MinStack {
*/
```
+#### Swift
+
```swift
class MinStack {
private var stk1: [Int]
diff --git a/lcci/03.02.Min Stack/README_EN.md b/lcci/03.02.Min Stack/README_EN.md
index c5b13e7138866..0b3e68c2cbfcb 100644
--- a/lcci/03.02.Min Stack/README_EN.md
+++ b/lcci/03.02.Min Stack/README_EN.md
@@ -55,6 +55,8 @@ For each operation, the time complexity is $O(1)$, and the space complexity is $
+#### Python3
+
```python
class MinStack:
def __init__(self):
@@ -87,6 +89,8 @@ class MinStack:
# param_4 = obj.getMin()
```
+#### Java
+
```java
class MinStack {
private Deque stk1 = new ArrayDeque<>();
@@ -126,6 +130,8 @@ class MinStack {
*/
```
+#### C++
+
```cpp
class MinStack {
public:
@@ -167,6 +173,8 @@ private:
*/
```
+#### Go
+
```go
type MinStack struct {
stk1 []int
@@ -206,6 +214,8 @@ func (this *MinStack) GetMin() int {
*/
```
+#### TypeScript
+
```ts
class MinStack {
stack: number[];
@@ -244,6 +254,8 @@ class MinStack {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
struct MinStack {
@@ -292,6 +304,8 @@ impl MinStack {
*/
```
+#### C#
+
```cs
public class MinStack {
private Stack stk1 = new Stack();
@@ -331,6 +345,8 @@ public class MinStack {
*/
```
+#### Swift
+
```swift
class MinStack {
private var stk1: [Int]
diff --git a/lcci/03.03.Stack of Plates/README.md b/lcci/03.03.Stack of Plates/README.md
index 2e13c86300a47..f7885e31c348f 100644
--- a/lcci/03.03.Stack of Plates/README.md
+++ b/lcci/03.03.Stack of Plates/README.md
@@ -49,6 +49,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/03.03.Stack%20of%20Pl
+#### Python3
+
```python
class StackOfPlates:
def __init__(self, cap: int):
@@ -81,6 +83,8 @@ class StackOfPlates:
# param_3 = obj.popAt(index)
```
+#### Java
+
```java
class StackOfPlates {
private List> stk = new ArrayList<>();
@@ -125,6 +129,8 @@ class StackOfPlates {
*/
```
+#### C++
+
```cpp
class StackOfPlates {
public:
@@ -172,6 +178,8 @@ private:
*/
```
+#### Go
+
```go
type StackOfPlates struct {
stk [][]int
@@ -218,6 +226,8 @@ func (this *StackOfPlates) PopAt(index int) int {
*/
```
+#### TypeScript
+
```ts
class StackOfPlates {
private cap: number;
@@ -271,6 +281,8 @@ class StackOfPlates {
*/
```
+#### Swift
+
```swift
class StackOfPlates {
private var stacks: [[Int]]
diff --git a/lcci/03.03.Stack of Plates/README_EN.md b/lcci/03.03.Stack of Plates/README_EN.md
index 9fdb975332bbe..b6043a77dbadc 100644
--- a/lcci/03.03.Stack of Plates/README_EN.md
+++ b/lcci/03.03.Stack of Plates/README_EN.md
@@ -65,6 +65,8 @@ The space complexity is $O(n)$, where $n$ is the number of elements.
+#### Python3
+
```python
class StackOfPlates:
def __init__(self, cap: int):
@@ -97,6 +99,8 @@ class StackOfPlates:
# param_3 = obj.popAt(index)
```
+#### Java
+
```java
class StackOfPlates {
private List> stk = new ArrayList<>();
@@ -141,6 +145,8 @@ class StackOfPlates {
*/
```
+#### C++
+
```cpp
class StackOfPlates {
public:
@@ -188,6 +194,8 @@ private:
*/
```
+#### Go
+
```go
type StackOfPlates struct {
stk [][]int
@@ -234,6 +242,8 @@ func (this *StackOfPlates) PopAt(index int) int {
*/
```
+#### TypeScript
+
```ts
class StackOfPlates {
private cap: number;
@@ -287,6 +297,8 @@ class StackOfPlates {
*/
```
+#### Swift
+
```swift
class StackOfPlates {
private var stacks: [[Int]]
diff --git a/lcci/03.04.Implement Queue using Stacks/README.md b/lcci/03.04.Implement Queue using Stacks/README.md
index b3c7d7d1f7bdf..d9334f3e5ad09 100644
--- a/lcci/03.04.Implement Queue using Stacks/README.md
+++ b/lcci/03.04.Implement Queue using Stacks/README.md
@@ -36,6 +36,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/03.04.Implement%20Que
+#### Python3
+
```python
class MyQueue:
def __init__(self):
@@ -70,6 +72,8 @@ class MyQueue:
# param_4 = obj.empty()
```
+#### Java
+
```java
class MyQueue {
private Deque stk1 = new ArrayDeque<>();
@@ -115,6 +119,8 @@ class MyQueue {
*/
```
+#### C++
+
```cpp
class MyQueue {
public:
@@ -165,6 +171,8 @@ private:
*/
```
+#### Go
+
```go
type MyQueue struct {
stk1 []int
@@ -214,6 +222,8 @@ func (this *MyQueue) move() {
*/
```
+#### TypeScript
+
```ts
class MyQueue {
stk1: number[];
@@ -261,6 +271,8 @@ class MyQueue {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
@@ -312,6 +324,8 @@ impl MyQueue {
*/
```
+#### Swift
+
```swift
class MyQueue {
private var stk1: [Int] = []
diff --git a/lcci/03.04.Implement Queue using Stacks/README_EN.md b/lcci/03.04.Implement Queue using Stacks/README_EN.md
index a8bc4aa75fbdd..3203a0cf45f70 100644
--- a/lcci/03.04.Implement Queue using Stacks/README_EN.md
+++ b/lcci/03.04.Implement Queue using Stacks/README_EN.md
@@ -68,6 +68,8 @@ When checking whether the queue is empty, we only need to check whether both sta
+#### Python3
+
```python
class MyQueue:
def __init__(self):
@@ -102,6 +104,8 @@ class MyQueue:
# param_4 = obj.empty()
```
+#### Java
+
```java
class MyQueue {
private Deque stk1 = new ArrayDeque<>();
@@ -147,6 +151,8 @@ class MyQueue {
*/
```
+#### C++
+
```cpp
class MyQueue {
public:
@@ -197,6 +203,8 @@ private:
*/
```
+#### Go
+
```go
type MyQueue struct {
stk1 []int
@@ -246,6 +254,8 @@ func (this *MyQueue) move() {
*/
```
+#### TypeScript
+
```ts
class MyQueue {
stk1: number[];
@@ -293,6 +303,8 @@ class MyQueue {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
@@ -344,6 +356,8 @@ impl MyQueue {
*/
```
+#### Swift
+
```swift
class MyQueue {
private var stk1: [Int] = []
diff --git a/lcci/03.05.Sort of Stacks/README.md b/lcci/03.05.Sort of Stacks/README.md
index 8e9ec883549ce..c1a2ee7701534 100644
--- a/lcci/03.05.Sort of Stacks/README.md
+++ b/lcci/03.05.Sort of Stacks/README.md
@@ -62,6 +62,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/03.05.Sort%20of%20Sta
+#### Python3
+
```python
class SortedStack:
@@ -95,6 +97,8 @@ class SortedStack:
# param_4 = obj.isEmpty()
```
+#### Java
+
```java
class SortedStack {
private Deque stk = new ArrayDeque<>();
@@ -138,6 +142,8 @@ class SortedStack {
*/
```
+#### C++
+
```cpp
class SortedStack {
public:
@@ -185,6 +191,8 @@ private:
*/
```
+#### Go
+
```go
type SortedStack struct {
stk []int
@@ -233,6 +241,8 @@ func (this *SortedStack) IsEmpty() bool {
*/
```
+#### TypeScript
+
```ts
class SortedStack {
private stk: number[] = [];
@@ -274,6 +284,8 @@ class SortedStack {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
@@ -327,6 +339,8 @@ impl SortedStack {
*/
```
+#### Swift
+
```swift
class SortedStack {
private var stk: [Int] = []
diff --git a/lcci/03.05.Sort of Stacks/README_EN.md b/lcci/03.05.Sort of Stacks/README_EN.md
index 95f6cc11a9762..e7070dcb7611c 100644
--- a/lcci/03.05.Sort of Stacks/README_EN.md
+++ b/lcci/03.05.Sort of Stacks/README_EN.md
@@ -76,6 +76,8 @@ The space complexity is $O(n)$, where $n$ is the number of elements in the stack
+#### Python3
+
```python
class SortedStack:
@@ -109,6 +111,8 @@ class SortedStack:
# param_4 = obj.isEmpty()
```
+#### Java
+
```java
class SortedStack {
private Deque stk = new ArrayDeque<>();
@@ -152,6 +156,8 @@ class SortedStack {
*/
```
+#### C++
+
```cpp
class SortedStack {
public:
@@ -199,6 +205,8 @@ private:
*/
```
+#### Go
+
```go
type SortedStack struct {
stk []int
@@ -247,6 +255,8 @@ func (this *SortedStack) IsEmpty() bool {
*/
```
+#### TypeScript
+
```ts
class SortedStack {
private stk: number[] = [];
@@ -288,6 +298,8 @@ class SortedStack {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
@@ -341,6 +353,8 @@ impl SortedStack {
*/
```
+#### Swift
+
```swift
class SortedStack {
private var stk: [Int] = []
diff --git a/lcci/03.06.Animal Shelter/README.md b/lcci/03.06.Animal Shelter/README.md
index a5890681ef1e2..08d9549b6b479 100644
--- a/lcci/03.06.Animal Shelter/README.md
+++ b/lcci/03.06.Animal Shelter/README.md
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/03.06.Animal%20Shelte
+#### Python3
+
```python
class AnimalShelf:
@@ -96,6 +98,8 @@ class AnimalShelf:
# param_4 = obj.dequeueCat()
```
+#### Java
+
```java
class AnimalShelf {
private Deque[] q = new Deque[2];
@@ -134,6 +138,8 @@ class AnimalShelf {
*/
```
+#### C++
+
```cpp
class AnimalShelf {
public:
@@ -183,6 +189,8 @@ private:
*/
```
+#### Go
+
```go
type AnimalShelf struct {
q [2][]int
@@ -231,6 +239,8 @@ func (this *AnimalShelf) DequeueCat() []int {
*/
```
+#### TypeScript
+
```ts
class AnimalShelf {
private q: number[][] = [[], []];
@@ -273,6 +283,8 @@ class AnimalShelf {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
@@ -329,6 +341,8 @@ impl AnimalShelf {
*/
```
+#### Swift
+
```swift
class AnimalShelf {
private var q: [[Int]] = Array(repeating: [], count: 2)
diff --git a/lcci/03.06.Animal Shelter/README_EN.md b/lcci/03.06.Animal Shelter/README_EN.md
index 0135adc825e6c..1732b08d89c39 100644
--- a/lcci/03.06.Animal Shelter/README_EN.md
+++ b/lcci/03.06.Animal Shelter/README_EN.md
@@ -80,6 +80,8 @@ The time complexity of the above operations is $O(1)$, and the space complexity
+#### Python3
+
```python
class AnimalShelf:
@@ -110,6 +112,8 @@ class AnimalShelf:
# param_4 = obj.dequeueCat()
```
+#### Java
+
```java
class AnimalShelf {
private Deque[] q = new Deque[2];
@@ -148,6 +152,8 @@ class AnimalShelf {
*/
```
+#### C++
+
```cpp
class AnimalShelf {
public:
@@ -197,6 +203,8 @@ private:
*/
```
+#### Go
+
```go
type AnimalShelf struct {
q [2][]int
@@ -245,6 +253,8 @@ func (this *AnimalShelf) DequeueCat() []int {
*/
```
+#### TypeScript
+
```ts
class AnimalShelf {
private q: number[][] = [[], []];
@@ -287,6 +297,8 @@ class AnimalShelf {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
@@ -343,6 +355,8 @@ impl AnimalShelf {
*/
```
+#### Swift
+
```swift
class AnimalShelf {
private var q: [[Int]] = Array(repeating: [], count: 2)
diff --git a/lcci/04.01.Route Between Nodes/README.md b/lcci/04.01.Route Between Nodes/README.md
index 758d9c3f60d4b..1846da42fc412 100644
--- a/lcci/04.01.Route Between Nodes/README.md
+++ b/lcci/04.01.Route Between Nodes/README.md
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.01.Route%20Between
+#### Python3
+
```python
class Solution:
def findWhetherExistsPath(
@@ -76,6 +78,8 @@ class Solution:
return dfs(start)
```
+#### Java
+
```java
class Solution {
private List[] g;
@@ -111,6 +115,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -140,6 +146,8 @@ public:
};
```
+#### Go
+
```go
func findWhetherExistsPath(n int, graph [][]int, start int, target int) bool {
g := make([][]int, n)
@@ -167,6 +175,8 @@ func findWhetherExistsPath(n int, graph [][]int, start int, target int) bool {
}
```
+#### TypeScript
+
```ts
function findWhetherExistsPath(
n: number,
@@ -193,6 +203,8 @@ function findWhetherExistsPath(
}
```
+#### Swift
+
```swift
class Solution {
private var g: [[Int]]!
@@ -241,6 +253,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def findWhetherExistsPath(
@@ -262,6 +276,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean findWhetherExistsPath(int n, int[][] graph, int start, int target) {
@@ -291,6 +307,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -320,6 +338,8 @@ public:
};
```
+#### Go
+
```go
func findWhetherExistsPath(n int, graph [][]int, start int, target int) bool {
g := make([][]int, n)
@@ -346,6 +366,8 @@ func findWhetherExistsPath(n int, graph [][]int, start int, target int) bool {
}
```
+#### TypeScript
+
```ts
function findWhetherExistsPath(
n: number,
diff --git a/lcci/04.01.Route Between Nodes/README_EN.md b/lcci/04.01.Route Between Nodes/README_EN.md
index 8b06372b153be..5205c2f35b5a8 100644
--- a/lcci/04.01.Route Between Nodes/README_EN.md
+++ b/lcci/04.01.Route Between Nodes/README_EN.md
@@ -64,6 +64,8 @@ The time complexity is $O(n + m)$, and the space complexity is $O(n + m)$, where
+#### Python3
+
```python
class Solution:
def findWhetherExistsPath(
@@ -84,6 +86,8 @@ class Solution:
return dfs(start)
```
+#### Java
+
```java
class Solution {
private List[] g;
@@ -119,6 +123,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -148,6 +154,8 @@ public:
};
```
+#### Go
+
```go
func findWhetherExistsPath(n int, graph [][]int, start int, target int) bool {
g := make([][]int, n)
@@ -175,6 +183,8 @@ func findWhetherExistsPath(n int, graph [][]int, start int, target int) bool {
}
```
+#### TypeScript
+
```ts
function findWhetherExistsPath(
n: number,
@@ -201,6 +211,8 @@ function findWhetherExistsPath(
}
```
+#### Swift
+
```swift
class Solution {
private var g: [[Int]]!
@@ -249,6 +261,8 @@ The time complexity is $O(n + m)$, and the space complexity is $O(n + m)$, where
+#### Python3
+
```python
class Solution:
def findWhetherExistsPath(
@@ -270,6 +284,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean findWhetherExistsPath(int n, int[][] graph, int start, int target) {
@@ -299,6 +315,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -328,6 +346,8 @@ public:
};
```
+#### Go
+
```go
func findWhetherExistsPath(n int, graph [][]int, start int, target int) bool {
g := make([][]int, n)
@@ -354,6 +374,8 @@ func findWhetherExistsPath(n int, graph [][]int, start int, target int) bool {
}
```
+#### TypeScript
+
```ts
function findWhetherExistsPath(
n: number,
diff --git a/lcci/04.02.Minimum Height Tree/README.md b/lcci/04.02.Minimum Height Tree/README.md
index e37849f23f194..7d3becafc1d44 100644
--- a/lcci/04.02.Minimum Height Tree/README.md
+++ b/lcci/04.02.Minimum Height Tree/README.md
@@ -36,6 +36,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.02.Minimum%20Heigh
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -56,6 +58,8 @@ class Solution:
return dfs(0, len(nums) - 1)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -109,6 +115,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -132,6 +140,8 @@ func sortedArrayToBST(nums []int) *TreeNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -159,6 +169,8 @@ function sortedArrayToBST(nums: number[]): TreeNode | null {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -202,6 +214,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -227,6 +241,8 @@ var sortedArrayToBST = function (nums) {
};
```
+#### Swift
+
```swift
/**
* class TreeNode {
diff --git a/lcci/04.02.Minimum Height Tree/README_EN.md b/lcci/04.02.Minimum Height Tree/README_EN.md
index 89c93a93304dc..f0b78ac54426d 100644
--- a/lcci/04.02.Minimum Height Tree/README_EN.md
+++ b/lcci/04.02.Minimum Height Tree/README_EN.md
@@ -60,6 +60,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$, where $n$ is
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -80,6 +82,8 @@ class Solution:
return dfs(0, len(nums) - 1)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -108,6 +112,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -133,6 +139,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -156,6 +164,8 @@ func sortedArrayToBST(nums []int) *TreeNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -183,6 +193,8 @@ function sortedArrayToBST(nums: number[]): TreeNode | null {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -226,6 +238,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -251,6 +265,8 @@ var sortedArrayToBST = function (nums) {
};
```
+#### Swift
+
```swift
/**
* class TreeNode {
diff --git a/lcci/04.03.List of Depth/README.md b/lcci/04.03.List of Depth/README.md
index 2efe453c60571..615480288e257 100644
--- a/lcci/04.03.List of Depth/README.md
+++ b/lcci/04.03.List of Depth/README.md
@@ -47,6 +47,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.03.List%20of%20Dep
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -80,6 +82,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -124,6 +128,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -169,6 +175,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -208,6 +216,8 @@ func listOfDepth(tree *TreeNode) (ans []*ListNode) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -254,6 +264,8 @@ function listOfDepth(tree: TreeNode | null): Array {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -324,6 +336,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.03.List of Depth/README_EN.md b/lcci/04.03.List of Depth/README_EN.md
index 3cf03bb913277..daf0f4a791c6e 100644
--- a/lcci/04.03.List of Depth/README_EN.md
+++ b/lcci/04.03.List of Depth/README_EN.md
@@ -60,6 +60,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$, where $n$ is
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -93,6 +95,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -137,6 +141,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -182,6 +188,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -221,6 +229,8 @@ func listOfDepth(tree *TreeNode) (ans []*ListNode) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -267,6 +277,8 @@ function listOfDepth(tree: TreeNode | null): Array {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -337,6 +349,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.04.Check Balance/README.md b/lcci/04.04.Check Balance/README.md
index 3d7923e8542e8..68135508df1b2 100644
--- a/lcci/04.04.Check Balance/README.md
+++ b/lcci/04.04.Check Balance/README.md
@@ -37,6 +37,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.04.Check%20Balance
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -59,6 +61,8 @@ class Solution:
return dfs(root) >= 0
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -88,6 +92,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -117,6 +123,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -149,6 +157,8 @@ func abs(x int) int {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -180,6 +190,8 @@ function isBalanced(root: TreeNode | null): boolean {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.04.Check Balance/README_EN.md b/lcci/04.04.Check Balance/README_EN.md
index 215a6893b31d8..cccad99d6552d 100644
--- a/lcci/04.04.Check Balance/README_EN.md
+++ b/lcci/04.04.Check Balance/README_EN.md
@@ -81,6 +81,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$, where $n$ is
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -103,6 +105,8 @@ class Solution:
return dfs(root) >= 0
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -132,6 +136,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -161,6 +167,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -193,6 +201,8 @@ func abs(x int) int {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -224,6 +234,8 @@ function isBalanced(root: TreeNode | null): boolean {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.05.Legal Binary Search Tree/README.md b/lcci/04.05.Legal Binary Search Tree/README.md
index 37f691ecaf297..07ac1398e2aee 100644
--- a/lcci/04.05.Legal Binary Search Tree/README.md
+++ b/lcci/04.05.Legal Binary Search Tree/README.md
@@ -32,6 +32,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.05.Legal%20Binary%
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -56,6 +58,8 @@ class Solution:
return dfs(root)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -95,6 +99,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -129,6 +135,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -158,6 +166,8 @@ func isValidBST(root *TreeNode) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -192,6 +202,8 @@ function isValidBST(root: TreeNode | null): boolean {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -235,6 +247,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -267,6 +281,8 @@ var isValidBST = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
@@ -304,6 +320,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.05.Legal Binary Search Tree/README_EN.md b/lcci/04.05.Legal Binary Search Tree/README_EN.md
index 2a69359ad2f87..7d8bdf3bcb0a2 100644
--- a/lcci/04.05.Legal Binary Search Tree/README_EN.md
+++ b/lcci/04.05.Legal Binary Search Tree/README_EN.md
@@ -70,6 +70,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Where $n$ is
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -94,6 +96,8 @@ class Solution:
return dfs(root)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -133,6 +137,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -167,6 +173,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -196,6 +204,8 @@ func isValidBST(root *TreeNode) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -230,6 +240,8 @@ function isValidBST(root: TreeNode | null): boolean {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -273,6 +285,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -305,6 +319,8 @@ var isValidBST = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
@@ -342,6 +358,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.06.Successor/README.md b/lcci/04.06.Successor/README.md
index c06ce49e1ac1d..3de1e7ef889d8 100644
--- a/lcci/04.06.Successor/README.md
+++ b/lcci/04.06.Successor/README.md
@@ -63,6 +63,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.06.Successor/READM
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -84,6 +86,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -110,6 +114,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -137,6 +143,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -159,6 +167,8 @@ func inorderSuccessor(root *TreeNode, p *TreeNode) (ans *TreeNode) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -188,6 +198,8 @@ function inorderSuccessor(root: TreeNode | null, p: TreeNode | null): TreeNode |
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -215,6 +227,8 @@ var inorderSuccessor = function (root, p) {
};
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.06.Successor/README_EN.md b/lcci/04.06.Successor/README_EN.md
index 70454c2becbf7..a965465400f8f 100644
--- a/lcci/04.06.Successor/README_EN.md
+++ b/lcci/04.06.Successor/README_EN.md
@@ -83,6 +83,8 @@ The time complexity is $O(h)$, where $h$ is the height of the binary search tree
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -104,6 +106,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -130,6 +134,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -157,6 +163,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -179,6 +187,8 @@ func inorderSuccessor(root *TreeNode, p *TreeNode) (ans *TreeNode) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -208,6 +218,8 @@ function inorderSuccessor(root: TreeNode | null, p: TreeNode | null): TreeNode |
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -235,6 +247,8 @@ var inorderSuccessor = function (root, p) {
};
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.08.First Common Ancestor/README.md b/lcci/04.08.First Common Ancestor/README.md
index 02e6ae928b8ad..d7a9fb878e8e4 100644
--- a/lcci/04.08.First Common Ancestor/README.md
+++ b/lcci/04.08.First Common Ancestor/README.md
@@ -26,6 +26,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.08.First%20Common%
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -46,6 +48,8 @@ class Solution:
return right if left is None else (left if right is None else root)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -68,6 +72,8 @@ class Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.08.First Common Ancestor/README_EN.md b/lcci/04.08.First Common Ancestor/README_EN.md
index 5ab2aa0c3a161..8df95cc286a11 100644
--- a/lcci/04.08.First Common Ancestor/README_EN.md
+++ b/lcci/04.08.First Common Ancestor/README_EN.md
@@ -73,6 +73,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.08.First%20Common%
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -93,6 +95,8 @@ class Solution:
return right if left is None else (left if right is None else root)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -115,6 +119,8 @@ class Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.09.BST Sequences/README.md b/lcci/04.09.BST Sequences/README.md
index 2197e9b33a583..0465a01b415c4 100644
--- a/lcci/04.09.BST Sequences/README.md
+++ b/lcci/04.09.BST Sequences/README.md
@@ -36,6 +36,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.09.BST%20Sequences
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.09.BST Sequences/README_EN.md b/lcci/04.09.BST Sequences/README_EN.md
index cb2fa0469de62..224590fbcc8ad 100644
--- a/lcci/04.09.BST Sequences/README_EN.md
+++ b/lcci/04.09.BST Sequences/README_EN.md
@@ -47,6 +47,8 @@ Given the following tree:
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.10.Check SubTree/README.md b/lcci/04.10.Check SubTree/README.md
index 46ecb56ad50ed..814f68f0563bc 100644
--- a/lcci/04.10.Check SubTree/README.md
+++ b/lcci/04.10.Check SubTree/README.md
@@ -54,6 +54,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.10.Check%20SubTree
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -81,6 +83,8 @@ class Solution:
return self.checkSubTree(t1.left, t2) or self.checkSubTree(t1.right, t2)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -117,6 +121,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -154,6 +160,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -187,6 +195,8 @@ func checkSubTree(t1 *TreeNode, t2 *TreeNode) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -225,6 +235,8 @@ function checkSubTree(t1: TreeNode | null, t2: TreeNode | null): boolean {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -282,6 +294,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.10.Check SubTree/README_EN.md b/lcci/04.10.Check SubTree/README_EN.md
index 5707ea337a38e..0f14c0e64f407 100644
--- a/lcci/04.10.Check SubTree/README_EN.md
+++ b/lcci/04.10.Check SubTree/README_EN.md
@@ -62,6 +62,8 @@ The time complexity is $O(n^2)$, and the space complexity is $O(n)$. Where $n$ i
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -89,6 +91,8 @@ class Solution:
return self.checkSubTree(t1.left, t2) or self.checkSubTree(t1.right, t2)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -125,6 +129,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -162,6 +168,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -195,6 +203,8 @@ func checkSubTree(t1 *TreeNode, t2 *TreeNode) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -233,6 +243,8 @@ function checkSubTree(t1: TreeNode | null, t2: TreeNode | null): boolean {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -290,6 +302,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.12.Paths with Sum/README.md b/lcci/04.12.Paths with Sum/README.md
index 9c3433036066e..011af3a4cc8b7 100644
--- a/lcci/04.12.Paths with Sum/README.md
+++ b/lcci/04.12.Paths with Sum/README.md
@@ -65,6 +65,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/04.12.Paths%20with%20
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -91,6 +93,8 @@ class Solution:
return dfs(root, 0)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -126,6 +130,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -158,6 +164,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -186,6 +194,8 @@ func pathSum(root *TreeNode, sum int) int {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -220,6 +230,8 @@ function pathSum(root: TreeNode | null, sum: number): number {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -270,6 +282,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/04.12.Paths with Sum/README_EN.md b/lcci/04.12.Paths with Sum/README_EN.md
index 26bc94d5cecf7..aa65137b0d795 100644
--- a/lcci/04.12.Paths with Sum/README_EN.md
+++ b/lcci/04.12.Paths with Sum/README_EN.md
@@ -78,6 +78,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -104,6 +106,8 @@ class Solution:
return dfs(root, 0)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -139,6 +143,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -171,6 +177,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -199,6 +207,8 @@ func pathSum(root *TreeNode, sum int) int {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -233,6 +243,8 @@ function pathSum(root: TreeNode | null, sum: number): number {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -283,6 +295,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
/* class TreeNode {
* var val: Int
diff --git a/lcci/05.01.Insert Into Bits/README.md b/lcci/05.01.Insert Into Bits/README.md
index 8b7c617edc2bb..02752bbb7e216 100644
--- a/lcci/05.01.Insert Into Bits/README.md
+++ b/lcci/05.01.Insert Into Bits/README.md
@@ -44,6 +44,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/05.01.Insert%20Into%2
+#### Python3
+
```python
class Solution:
def insertBits(self, N: int, M: int, i: int, j: int) -> int:
@@ -52,6 +54,8 @@ class Solution:
return N | M << i
```
+#### Java
+
```java
class Solution {
public int insertBits(int N, int M, int i, int j) {
@@ -63,6 +67,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -75,6 +81,8 @@ public:
};
```
+#### Go
+
```go
func insertBits(N int, M int, i int, j int) int {
for k := i; k <= j; k++ {
@@ -84,6 +92,8 @@ func insertBits(N int, M int, i int, j int) int {
}
```
+#### TypeScript
+
```ts
function insertBits(N: number, M: number, i: number, j: number): number {
for (let k = i; k <= j; ++k) {
@@ -93,6 +103,8 @@ function insertBits(N: number, M: number, i: number, j: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func insertBits(_ N: Int, _ M: Int, _ i: Int, _ j: Int) -> Int {
diff --git a/lcci/05.01.Insert Into Bits/README_EN.md b/lcci/05.01.Insert Into Bits/README_EN.md
index d30fe3e501bac..c84f6346a3377 100644
--- a/lcci/05.01.Insert Into Bits/README_EN.md
+++ b/lcci/05.01.Insert Into Bits/README_EN.md
@@ -46,6 +46,8 @@ The time complexity is $O(\log n)$, where $n$ is the size of $N$. The space comp
+#### Python3
+
```python
class Solution:
def insertBits(self, N: int, M: int, i: int, j: int) -> int:
@@ -54,6 +56,8 @@ class Solution:
return N | M << i
```
+#### Java
+
```java
class Solution {
public int insertBits(int N, int M, int i, int j) {
@@ -65,6 +69,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -77,6 +83,8 @@ public:
};
```
+#### Go
+
```go
func insertBits(N int, M int, i int, j int) int {
for k := i; k <= j; k++ {
@@ -86,6 +94,8 @@ func insertBits(N int, M int, i int, j int) int {
}
```
+#### TypeScript
+
```ts
function insertBits(N: number, M: number, i: number, j: number): number {
for (let k = i; k <= j; ++k) {
@@ -95,6 +105,8 @@ function insertBits(N: number, M: number, i: number, j: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func insertBits(_ N: Int, _ M: Int, _ i: Int, _ j: Int) -> Int {
diff --git a/lcci/05.02.Binary Number to String/README.md b/lcci/05.02.Binary Number to String/README.md
index bd9c38cb999e9..e65e49dbeebdc 100644
--- a/lcci/05.02.Binary Number to String/README.md
+++ b/lcci/05.02.Binary Number to String/README.md
@@ -59,6 +59,8 @@ $$
+#### Python3
+
```python
class Solution:
def printBin(self, num: float) -> str:
@@ -71,6 +73,8 @@ class Solution:
return 'ERROR' if num else ans
```
+#### Java
+
```java
class Solution {
public String printBin(double num) {
@@ -86,6 +90,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -102,6 +108,8 @@ public:
};
```
+#### Go
+
```go
func printBin(num float64) string {
ans := &strings.Builder{}
@@ -119,6 +127,8 @@ func printBin(num float64) string {
}
```
+#### Swift
+
```swift
class Solution {
func printBin(_ num: Double) -> String {
diff --git a/lcci/05.02.Binary Number to String/README_EN.md b/lcci/05.02.Binary Number to String/README_EN.md
index cdc421a10a220..c54d0c6cad2b3 100644
--- a/lcci/05.02.Binary Number to String/README_EN.md
+++ b/lcci/05.02.Binary Number to String/README_EN.md
@@ -68,6 +68,8 @@ The time complexity is $O(C)$, and the space complexity is $O(C)$. Here, $C$ is
+#### Python3
+
```python
class Solution:
def printBin(self, num: float) -> str:
@@ -80,6 +82,8 @@ class Solution:
return 'ERROR' if num else ans
```
+#### Java
+
```java
class Solution {
public String printBin(double num) {
@@ -95,6 +99,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -111,6 +117,8 @@ public:
};
```
+#### Go
+
```go
func printBin(num float64) string {
ans := &strings.Builder{}
@@ -128,6 +136,8 @@ func printBin(num float64) string {
}
```
+#### Swift
+
```swift
class Solution {
func printBin(_ num: Double) -> String {
diff --git a/lcci/05.03.Reverse Bits/README.md b/lcci/05.03.Reverse Bits/README.md
index 6a1892163908b..cbec7bc2a611d 100644
--- a/lcci/05.03.Reverse Bits/README.md
+++ b/lcci/05.03.Reverse Bits/README.md
@@ -40,6 +40,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/05.03.Reverse%20Bits/
+#### Python3
+
```python
class Solution:
def reverseBits(self, num: int) -> int:
@@ -53,6 +55,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int reverseBits(int num) {
@@ -70,6 +74,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -88,6 +94,8 @@ public:
};
```
+#### Go
+
```go
func reverseBits(num int) (ans int) {
var cnt, j int
@@ -103,6 +111,8 @@ func reverseBits(num int) (ans int) {
}
```
+#### TypeScript
+
```ts
function reverseBits(num: number): number {
let ans = 0;
@@ -118,6 +128,8 @@ function reverseBits(num: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func reverseBits(_ num: Int) -> Int {
diff --git a/lcci/05.03.Reverse Bits/README_EN.md b/lcci/05.03.Reverse Bits/README_EN.md
index ed2ac9f5b81ac..eb68a91114262 100644
--- a/lcci/05.03.Reverse Bits/README_EN.md
+++ b/lcci/05.03.Reverse Bits/README_EN.md
@@ -48,6 +48,8 @@ The time complexity is $O(\log M)$, and the space complexity is $O(1)$. Here, $M
+#### Python3
+
```python
class Solution:
def reverseBits(self, num: int) -> int:
@@ -61,6 +63,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int reverseBits(int num) {
@@ -78,6 +82,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -96,6 +102,8 @@ public:
};
```
+#### Go
+
```go
func reverseBits(num int) (ans int) {
var cnt, j int
@@ -111,6 +119,8 @@ func reverseBits(num int) (ans int) {
}
```
+#### TypeScript
+
```ts
function reverseBits(num: number): number {
let ans = 0;
@@ -126,6 +136,8 @@ function reverseBits(num: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func reverseBits(_ num: Int) -> Int {
diff --git a/lcci/05.04.Closed Number/README.md b/lcci/05.04.Closed Number/README.md
index d80f420b6dcb8..7bb1260799586 100644
--- a/lcci/05.04.Closed Number/README.md
+++ b/lcci/05.04.Closed Number/README.md
@@ -53,6 +53,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/05.04.Closed%20Number
+#### Python3
+
```python
class Solution:
def findClosedNumbers(self, num: int) -> List[int]:
@@ -79,6 +81,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] findClosedNumbers(int num) {
@@ -114,6 +118,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -150,6 +156,8 @@ public:
};
```
+#### Go
+
```go
func findClosedNumbers(num int) []int {
ans := []int{-1, -1}
@@ -183,6 +191,8 @@ func findClosedNumbers(num int) []int {
}
```
+#### TypeScript
+
```ts
function findClosedNumbers(num: number): number[] {
const ans: number[] = [-1, -1];
@@ -216,6 +226,8 @@ function findClosedNumbers(num: number): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func findClosedNumbers(_ num: Int) -> [Int] {
diff --git a/lcci/05.04.Closed Number/README_EN.md b/lcci/05.04.Closed Number/README_EN.md
index 4c48db1d1a6c2..c237a12aa7c3b 100644
--- a/lcci/05.04.Closed Number/README_EN.md
+++ b/lcci/05.04.Closed Number/README_EN.md
@@ -59,6 +59,8 @@ The time complexity is $O(\log n)$, where $n$ is the size of $num$. The space co
+#### Python3
+
```python
class Solution:
def findClosedNumbers(self, num: int) -> List[int]:
@@ -85,6 +87,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] findClosedNumbers(int num) {
@@ -120,6 +124,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -156,6 +162,8 @@ public:
};
```
+#### Go
+
```go
func findClosedNumbers(num int) []int {
ans := []int{-1, -1}
@@ -189,6 +197,8 @@ func findClosedNumbers(num int) []int {
}
```
+#### TypeScript
+
```ts
function findClosedNumbers(num: number): number[] {
const ans: number[] = [-1, -1];
@@ -222,6 +232,8 @@ function findClosedNumbers(num: number): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func findClosedNumbers(_ num: Int) -> [Int] {
diff --git a/lcci/05.06.Convert Integer/README.md b/lcci/05.06.Convert Integer/README.md
index 9a2fefc4fddbc..40b607d746147 100644
--- a/lcci/05.06.Convert Integer/README.md
+++ b/lcci/05.06.Convert Integer/README.md
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/05.06.Convert%20Integ
+#### Python3
+
```python
class Solution:
def convertInteger(self, A: int, B: int) -> int:
@@ -58,6 +60,8 @@ class Solution:
return (A ^ B).bit_count()
```
+#### Java
+
```java
class Solution {
public int convertInteger(int A, int B) {
@@ -66,6 +70,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -76,12 +82,16 @@ public:
};
```
+#### Go
+
```go
func convertInteger(A int, B int) int {
return bits.OnesCount32(uint32(A ^ B))
}
```
+#### TypeScript
+
```ts
function convertInteger(A: number, B: number): number {
let res = 0;
@@ -96,6 +106,8 @@ function convertInteger(A: number, B: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn convert_integer(a: i32, b: i32) -> i32 {
@@ -104,6 +116,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func convertInteger(_ A: Int, _ B: Int) -> Int {
diff --git a/lcci/05.06.Convert Integer/README_EN.md b/lcci/05.06.Convert Integer/README_EN.md
index 03d05c26a4a5e..3df91731cea2a 100644
--- a/lcci/05.06.Convert Integer/README_EN.md
+++ b/lcci/05.06.Convert Integer/README_EN.md
@@ -68,6 +68,8 @@ The time complexity is $O(\log n)$, where $n$ is the maximum value of A and B. T
+#### Python3
+
```python
class Solution:
def convertInteger(self, A: int, B: int) -> int:
@@ -76,6 +78,8 @@ class Solution:
return (A ^ B).bit_count()
```
+#### Java
+
```java
class Solution {
public int convertInteger(int A, int B) {
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -94,12 +100,16 @@ public:
};
```
+#### Go
+
```go
func convertInteger(A int, B int) int {
return bits.OnesCount32(uint32(A ^ B))
}
```
+#### TypeScript
+
```ts
function convertInteger(A: number, B: number): number {
let res = 0;
@@ -114,6 +124,8 @@ function convertInteger(A: number, B: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn convert_integer(a: i32, b: i32) -> i32 {
@@ -122,6 +134,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func convertInteger(_ A: Int, _ B: Int) -> Int {
diff --git a/lcci/05.07.Exchange/README.md b/lcci/05.07.Exchange/README.md
index e7e7421ef6c97..ea45ce6241d41 100644
--- a/lcci/05.07.Exchange/README.md
+++ b/lcci/05.07.Exchange/README.md
@@ -50,12 +50,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/05.07.Exchange/README
+#### Python3
+
```python
class Solution:
def exchangeBits(self, num: int) -> int:
return ((num & 0x55555555) << 1) | ((num & 0xAAAAAAAA) >> 1)
```
+#### Java
+
```java
class Solution {
public int exchangeBits(int num) {
@@ -64,6 +68,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -73,18 +79,24 @@ public:
};
```
+#### Go
+
```go
func exchangeBits(num int) int {
return ((num & 0x55555555) << 1) | (num&0xaaaaaaaa)>>1
}
```
+#### TypeScript
+
```ts
function exchangeBits(num: number): number {
return ((num & 0x55555555) << 1) | ((num & 0xaaaaaaaa) >>> 1);
}
```
+#### Rust
+
```rust
impl Solution {
pub fn exchange_bits(num: i32) -> i32 {
@@ -94,6 +106,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func exchangeBits(_ num: Int) -> Int {
diff --git a/lcci/05.07.Exchange/README_EN.md b/lcci/05.07.Exchange/README_EN.md
index a547725c4888b..8b8d849ac6817 100644
--- a/lcci/05.07.Exchange/README_EN.md
+++ b/lcci/05.07.Exchange/README_EN.md
@@ -57,12 +57,16 @@ The time complexity is $O(1)$, and the space complexity is $O(1)$.
+#### Python3
+
```python
class Solution:
def exchangeBits(self, num: int) -> int:
return ((num & 0x55555555) << 1) | ((num & 0xAAAAAAAA) >> 1)
```
+#### Java
+
```java
class Solution {
public int exchangeBits(int num) {
@@ -71,6 +75,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -80,18 +86,24 @@ public:
};
```
+#### Go
+
```go
func exchangeBits(num int) int {
return ((num & 0x55555555) << 1) | (num&0xaaaaaaaa)>>1
}
```
+#### TypeScript
+
```ts
function exchangeBits(num: number): number {
return ((num & 0x55555555) << 1) | ((num & 0xaaaaaaaa) >>> 1);
}
```
+#### Rust
+
```rust
impl Solution {
pub fn exchange_bits(num: i32) -> i32 {
@@ -101,6 +113,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func exchangeBits(_ num: Int) -> Int {
diff --git a/lcci/05.08.Draw Line/README.md b/lcci/05.08.Draw Line/README.md
index 6c3718916482e..f467f9482fc40 100644
--- a/lcci/05.08.Draw Line/README.md
+++ b/lcci/05.08.Draw Line/README.md
@@ -44,6 +44,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/05.08.Draw%20Line/REA
+#### Python3
+
```python
class Solution:
def drawLine(self, length: int, w: int, x1: int, x2: int, y: int) -> List[int]:
@@ -57,6 +59,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] drawLine(int length, int w, int x1, int x2, int y) {
@@ -73,6 +77,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
diff --git a/lcci/05.08.Draw Line/README_EN.md b/lcci/05.08.Draw Line/README_EN.md
index 7244d03ebee3b..9d1ff63a0076f 100644
--- a/lcci/05.08.Draw Line/README_EN.md
+++ b/lcci/05.08.Draw Line/README_EN.md
@@ -53,6 +53,8 @@ The time complexity is $O(1)$, and the space complexity is $O(1)$.
+#### Python3
+
```python
class Solution:
def drawLine(self, length: int, w: int, x1: int, x2: int, y: int) -> List[int]:
@@ -66,6 +68,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] drawLine(int length, int w, int x1, int x2, int y) {
@@ -82,6 +86,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
diff --git a/lcci/08.01.Three Steps Problem/README.md b/lcci/08.01.Three Steps Problem/README.md
index 892a670937eb9..421461ed9d774 100644
--- a/lcci/08.01.Three Steps Problem/README.md
+++ b/lcci/08.01.Three Steps Problem/README.md
@@ -55,6 +55,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.01.Three%20Steps%2
+#### Python3
+
```python
class Solution:
def waysToStep(self, n: int) -> int:
@@ -65,6 +67,8 @@ class Solution:
return a
```
+#### Java
+
```java
class Solution {
public int waysToStep(int n) {
@@ -81,6 +85,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -98,6 +104,8 @@ public:
};
```
+#### Go
+
```go
func waysToStep(n int) int {
const mod int = 1e9 + 7
@@ -109,6 +117,8 @@ func waysToStep(n int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn ways_to_step(n: i32) -> i32 {
@@ -125,6 +135,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -140,6 +152,8 @@ var waysToStep = function (n) {
};
```
+#### C
+
```c
int waysToStep(int n) {
const int mod = 1e9 + 7;
@@ -154,6 +168,8 @@ int waysToStep(int n) {
}
```
+#### Swift
+
```swift
class Solution {
func waysToStep(_ n: Int) -> Int {
@@ -208,6 +224,8 @@ $$
+#### Python3
+
```python
class Solution:
def waysToStep(self, n: int) -> int:
@@ -237,6 +255,8 @@ class Solution:
return sum(pow(a, n - 4)[0]) % mod
```
+#### Python3
+
```python
import numpy as np
@@ -257,6 +277,8 @@ class Solution:
return res.sum() % mod
```
+#### Java
+
```java
class Solution {
private final int mod = (int) 1e9 + 7;
@@ -301,6 +323,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -347,6 +371,8 @@ private:
};
```
+#### Go
+
```go
const mod = 1e9 + 7
@@ -391,6 +417,8 @@ func pow(a [][]int, n int) [][]int {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
diff --git a/lcci/08.01.Three Steps Problem/README_EN.md b/lcci/08.01.Three Steps Problem/README_EN.md
index e3aeb6156a89a..93d93478b8bef 100644
--- a/lcci/08.01.Three Steps Problem/README_EN.md
+++ b/lcci/08.01.Three Steps Problem/README_EN.md
@@ -58,6 +58,8 @@ The time complexity is $O(n)$, where $n$ is the given integer. The space complex
+#### Python3
+
```python
class Solution:
def waysToStep(self, n: int) -> int:
@@ -68,6 +70,8 @@ class Solution:
return a
```
+#### Java
+
```java
class Solution {
public int waysToStep(int n) {
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -101,6 +107,8 @@ public:
};
```
+#### Go
+
```go
func waysToStep(n int) int {
const mod int = 1e9 + 7
@@ -112,6 +120,8 @@ func waysToStep(n int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn ways_to_step(n: i32) -> i32 {
@@ -128,6 +138,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -143,6 +155,8 @@ var waysToStep = function (n) {
};
```
+#### C
+
```c
int waysToStep(int n) {
const int mod = 1e9 + 7;
@@ -157,6 +171,8 @@ int waysToStep(int n) {
}
```
+#### Swift
+
```swift
class Solution {
func waysToStep(_ n: Int) -> Int {
@@ -211,6 +227,8 @@ The time complexity is $O(\log n)$, and the space complexity is $O(1)$.
+#### Python3
+
```python
class Solution:
def waysToStep(self, n: int) -> int:
@@ -240,6 +258,8 @@ class Solution:
return sum(pow(a, n - 4)[0]) % mod
```
+#### Python3
+
```python
import numpy as np
@@ -260,6 +280,8 @@ class Solution:
return res.sum() % mod
```
+#### Java
+
```java
class Solution {
private final int mod = (int) 1e9 + 7;
@@ -304,6 +326,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -350,6 +374,8 @@ private:
};
```
+#### Go
+
```go
const mod = 1e9 + 7
@@ -394,6 +420,8 @@ func pow(a [][]int, n int) [][]int {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
diff --git a/lcci/08.02.Robot in a Grid/README.md b/lcci/08.02.Robot in a Grid/README.md
index c97f2fbecad98..a13e2f594e13c 100644
--- a/lcci/08.02.Robot in a Grid/README.md
+++ b/lcci/08.02.Robot in a Grid/README.md
@@ -47,6 +47,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.02.Robot%20in%20a%
+#### Python3
+
```python
class Solution:
def pathWithObstacles(self, obstacleGrid: List[List[int]]) -> List[List[int]]:
@@ -65,6 +67,8 @@ class Solution:
return ans if dfs(0, 0) else []
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -94,6 +98,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -118,6 +124,8 @@ public:
};
```
+#### Go
+
```go
func pathWithObstacles(obstacleGrid [][]int) [][]int {
m, n := len(obstacleGrid), len(obstacleGrid[0])
@@ -142,6 +150,8 @@ func pathWithObstacles(obstacleGrid [][]int) [][]int {
}
```
+#### TypeScript
+
```ts
function pathWithObstacles(obstacleGrid: number[][]): number[][] {
const m = obstacleGrid.length;
@@ -166,6 +176,8 @@ function pathWithObstacles(obstacleGrid: number[][]): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(grid: &mut Vec>, path: &mut Vec>, i: usize, j: usize) -> bool {
@@ -195,6 +207,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
private var ans = [[Int]]()
diff --git a/lcci/08.02.Robot in a Grid/README_EN.md b/lcci/08.02.Robot in a Grid/README_EN.md
index 7e43f02412b44..07603c08178fc 100644
--- a/lcci/08.02.Robot in a Grid/README_EN.md
+++ b/lcci/08.02.Robot in a Grid/README_EN.md
@@ -56,6 +56,8 @@ The time complexity is $O(m \times n)$, and the space complexity is $O(m \times
+#### Python3
+
```python
class Solution:
def pathWithObstacles(self, obstacleGrid: List[List[int]]) -> List[List[int]]:
@@ -74,6 +76,8 @@ class Solution:
return ans if dfs(0, 0) else []
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -103,6 +107,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -127,6 +133,8 @@ public:
};
```
+#### Go
+
```go
func pathWithObstacles(obstacleGrid [][]int) [][]int {
m, n := len(obstacleGrid), len(obstacleGrid[0])
@@ -151,6 +159,8 @@ func pathWithObstacles(obstacleGrid [][]int) [][]int {
}
```
+#### TypeScript
+
```ts
function pathWithObstacles(obstacleGrid: number[][]): number[][] {
const m = obstacleGrid.length;
@@ -175,6 +185,8 @@ function pathWithObstacles(obstacleGrid: number[][]): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(grid: &mut Vec>, path: &mut Vec>, i: usize, j: usize) -> bool {
@@ -204,6 +216,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
private var ans = [[Int]]()
diff --git a/lcci/08.03.Magic Index/README.md b/lcci/08.03.Magic Index/README.md
index 9f677282e10bb..cab927034e5ea 100644
--- a/lcci/08.03.Magic Index/README.md
+++ b/lcci/08.03.Magic Index/README.md
@@ -54,6 +54,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.03.Magic%20Index/R
+#### Python3
+
```python
class Solution:
def findMagicIndex(self, nums: List[int]) -> int:
@@ -71,6 +73,8 @@ class Solution:
return dfs(0, len(nums) - 1)
```
+#### Java
+
```java
class Solution {
public int findMagicIndex(int[] nums) {
@@ -94,6 +98,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -117,6 +123,8 @@ public:
};
```
+#### Go
+
```go
func findMagicIndex(nums []int) int {
var dfs func(i, j int) int
@@ -137,6 +145,8 @@ func findMagicIndex(nums []int) int {
}
```
+#### TypeScript
+
```ts
function findMagicIndex(nums: number[]): number {
const dfs = (i: number, j: number): number => {
@@ -157,6 +167,8 @@ function findMagicIndex(nums: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(nums: &Vec, i: usize, j: usize) -> i32 {
@@ -182,6 +194,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -206,6 +220,8 @@ var findMagicIndex = function (nums) {
};
```
+#### Swift
+
```swift
class Solution {
func findMagicIndex(_ nums: [Int]) -> Int {
diff --git a/lcci/08.03.Magic Index/README_EN.md b/lcci/08.03.Magic Index/README_EN.md
index 20ebc175c3db9..f2378b50c0365 100644
--- a/lcci/08.03.Magic Index/README_EN.md
+++ b/lcci/08.03.Magic Index/README_EN.md
@@ -61,6 +61,8 @@ In the worst case, the time complexity is $O(n)$, and the space complexity is $O
+#### Python3
+
```python
class Solution:
def findMagicIndex(self, nums: List[int]) -> int:
@@ -78,6 +80,8 @@ class Solution:
return dfs(0, len(nums) - 1)
```
+#### Java
+
```java
class Solution {
public int findMagicIndex(int[] nums) {
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -124,6 +130,8 @@ public:
};
```
+#### Go
+
```go
func findMagicIndex(nums []int) int {
var dfs func(i, j int) int
@@ -144,6 +152,8 @@ func findMagicIndex(nums []int) int {
}
```
+#### TypeScript
+
```ts
function findMagicIndex(nums: number[]): number {
const dfs = (i: number, j: number): number => {
@@ -164,6 +174,8 @@ function findMagicIndex(nums: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(nums: &Vec, i: usize, j: usize) -> i32 {
@@ -189,6 +201,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -213,6 +227,8 @@ var findMagicIndex = function (nums) {
};
```
+#### Swift
+
```swift
class Solution {
func findMagicIndex(_ nums: [Int]) -> Int {
diff --git a/lcci/08.04.Power Set/README.md b/lcci/08.04.Power Set/README.md
index 4dd2d14feed6b..3d158833ea132 100644
--- a/lcci/08.04.Power Set/README.md
+++ b/lcci/08.04.Power Set/README.md
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.04.Power%20Set/REA
+#### Python3
+
```python
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
@@ -67,6 +69,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -91,6 +95,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -114,6 +120,8 @@ public:
};
```
+#### Go
+
```go
func subsets(nums []int) [][]int {
var ans [][]int
@@ -134,6 +142,8 @@ func subsets(nums []int) [][]int {
}
```
+#### TypeScript
+
```ts
function subsets(nums: number[]): number[][] {
const res = [[]];
@@ -146,6 +156,8 @@ function subsets(nums: number[]): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn subsets(nums: Vec) -> Vec> {
@@ -161,6 +173,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -184,6 +198,8 @@ function dfs(nums, depth, prev, res) {
}
```
+#### Swift
+
```swift
class Solution {
private var ans = [[Int]]()
@@ -224,6 +240,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
@@ -237,6 +255,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List> subsets(int[] nums) {
@@ -256,6 +276,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -277,6 +299,8 @@ public:
};
```
+#### Go
+
```go
func subsets(nums []int) [][]int {
var ans [][]int
@@ -294,6 +318,8 @@ func subsets(nums []int) [][]int {
}
```
+#### TypeScript
+
```ts
function subsets(nums: number[]): number[][] {
const n = nums.length;
@@ -314,6 +340,8 @@ function subsets(nums: number[]): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(nums: &Vec, i: usize, res: &mut Vec>, list: &mut Vec) {
diff --git a/lcci/08.04.Power Set/README_EN.md b/lcci/08.04.Power Set/README_EN.md
index fd8d7666f0328..bce77529749ec 100644
--- a/lcci/08.04.Power Set/README_EN.md
+++ b/lcci/08.04.Power Set/README_EN.md
@@ -64,6 +64,8 @@ The time complexity is $O(n \times 2^n)$, and the space complexity is $O(n)$. He
+#### Python3
+
```python
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
@@ -81,6 +83,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -105,6 +109,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -128,6 +134,8 @@ public:
};
```
+#### Go
+
```go
func subsets(nums []int) [][]int {
var ans [][]int
@@ -148,6 +156,8 @@ func subsets(nums []int) [][]int {
}
```
+#### TypeScript
+
```ts
function subsets(nums: number[]): number[][] {
const res = [[]];
@@ -160,6 +170,8 @@ function subsets(nums: number[]): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn subsets(nums: Vec) -> Vec> {
@@ -175,6 +187,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -198,6 +212,8 @@ function dfs(nums, depth, prev, res) {
}
```
+#### Swift
+
```swift
class Solution {
private var ans = [[Int]]()
@@ -238,6 +254,8 @@ The time complexity is $O(n \times 2^n)$, and the space complexity is $O(n)$. He
+#### Python3
+
```python
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
@@ -251,6 +269,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List> subsets(int[] nums) {
@@ -270,6 +290,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -291,6 +313,8 @@ public:
};
```
+#### Go
+
```go
func subsets(nums []int) [][]int {
var ans [][]int
@@ -308,6 +332,8 @@ func subsets(nums []int) [][]int {
}
```
+#### TypeScript
+
```ts
function subsets(nums: number[]): number[][] {
const n = nums.length;
@@ -328,6 +354,8 @@ function subsets(nums: number[]): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(nums: &Vec, i: usize, res: &mut Vec>, list: &mut Vec) {
diff --git a/lcci/08.05.Recursive Mulitply/README.md b/lcci/08.05.Recursive Mulitply/README.md
index 4a6c46995d827..3400e8743a13b 100644
--- a/lcci/08.05.Recursive Mulitply/README.md
+++ b/lcci/08.05.Recursive Mulitply/README.md
@@ -46,6 +46,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.05.Recursive%20Mul
+#### Python3
+
```python
class Solution:
def multiply(self, A: int, B: int) -> int:
@@ -56,6 +58,8 @@ class Solution:
return self.multiply(A, B >> 1) << 1
```
+#### Java
+
```java
class Solution {
public int multiply(int A, int B) {
@@ -70,6 +74,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -85,6 +91,8 @@ public:
};
```
+#### Go
+
```go
func multiply(A int, B int) int {
if B == 1 {
@@ -97,6 +105,8 @@ func multiply(A int, B int) int {
}
```
+#### TypeScript
+
```ts
function multiply(A: number, B: number): number {
if (B === 1) {
@@ -109,6 +119,8 @@ function multiply(A: number, B: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn multiply(a: i32, b: i32) -> i32 {
@@ -123,6 +135,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func multiply(_ A: Int, _ B: Int) -> Int {
diff --git a/lcci/08.05.Recursive Mulitply/README_EN.md b/lcci/08.05.Recursive Mulitply/README_EN.md
index ca4c7a1b95414..54fa023d7a968 100644
--- a/lcci/08.05.Recursive Mulitply/README_EN.md
+++ b/lcci/08.05.Recursive Mulitply/README_EN.md
@@ -52,6 +52,8 @@ The time complexity is $O(\log n)$, and the space complexity is $O(\log n)$. Her
+#### Python3
+
```python
class Solution:
def multiply(self, A: int, B: int) -> int:
@@ -62,6 +64,8 @@ class Solution:
return self.multiply(A, B >> 1) << 1
```
+#### Java
+
```java
class Solution {
public int multiply(int A, int B) {
@@ -76,6 +80,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -91,6 +97,8 @@ public:
};
```
+#### Go
+
```go
func multiply(A int, B int) int {
if B == 1 {
@@ -103,6 +111,8 @@ func multiply(A int, B int) int {
}
```
+#### TypeScript
+
```ts
function multiply(A: number, B: number): number {
if (B === 1) {
@@ -115,6 +125,8 @@ function multiply(A: number, B: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn multiply(a: i32, b: i32) -> i32 {
@@ -129,6 +141,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func multiply(_ A: Int, _ B: Int) -> Int {
diff --git a/lcci/08.06.Hanota/README.md b/lcci/08.06.Hanota/README.md
index 655f5fc296e37..04efe8940d384 100644
--- a/lcci/08.06.Hanota/README.md
+++ b/lcci/08.06.Hanota/README.md
@@ -49,6 +49,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.06.Hanota/README.m
+#### Python3
+
```python
class Solution:
def hanota(self, A: List[int], B: List[int], C: List[int]) -> None:
@@ -63,6 +65,8 @@ class Solution:
dfs(len(A), A, B, C)
```
+#### Java
+
```java
class Solution {
public void hanota(List A, List B, List C) {
@@ -81,6 +85,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -101,6 +107,8 @@ public:
};
```
+#### Go
+
```go
func hanota(A []int, B []int, C []int) []int {
var dfs func(n int, a, b, c *[]int)
@@ -120,6 +128,8 @@ func hanota(A []int, B []int, C []int) []int {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify C in-place instead.
@@ -138,6 +148,8 @@ function hanota(A: number[], B: number[], C: number[]): void {
}
```
+#### Swift
+
```swift
class Solution {
func hanota(_ A: inout [Int], _ B: inout [Int], _ C: inout [Int]) {
@@ -182,6 +194,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def hanota(self, A: List[int], B: List[int], C: List[int]) -> None:
@@ -196,6 +210,8 @@ class Solution:
stk.append((n - 1, a, c, b))
```
+#### Java
+
```java
class Solution {
public void hanota(List A, List B, List C) {
@@ -233,6 +249,8 @@ class Task {
}
```
+#### C++
+
```cpp
struct Task {
int n;
@@ -262,6 +280,8 @@ public:
};
```
+#### Go
+
```go
func hanota(A []int, B []int, C []int) []int {
stk := []Task{{len(A), &A, &B, &C}}
@@ -286,6 +306,8 @@ type Task struct {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify C in-place instead.
diff --git a/lcci/08.06.Hanota/README_EN.md b/lcci/08.06.Hanota/README_EN.md
index 89b44eb40005a..6d4243950efb0 100644
--- a/lcci/08.06.Hanota/README_EN.md
+++ b/lcci/08.06.Hanota/README_EN.md
@@ -56,6 +56,8 @@ The time complexity is $O(2^n)$, and the space complexity is $O(n)$. Here, $n$ i
+#### Python3
+
```python
class Solution:
def hanota(self, A: List[int], B: List[int], C: List[int]) -> None:
@@ -70,6 +72,8 @@ class Solution:
dfs(len(A), A, B, C)
```
+#### Java
+
```java
class Solution {
public void hanota(List A, List B, List C) {
@@ -88,6 +92,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -108,6 +114,8 @@ public:
};
```
+#### Go
+
```go
func hanota(A []int, B []int, C []int) []int {
var dfs func(n int, a, b, c *[]int)
@@ -127,6 +135,8 @@ func hanota(A []int, B []int, C []int) []int {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify C in-place instead.
@@ -145,6 +155,8 @@ function hanota(A: number[], B: number[], C: number[]): void {
}
```
+#### Swift
+
```swift
class Solution {
func hanota(_ A: inout [Int], _ B: inout [Int], _ C: inout [Int]) {
@@ -189,6 +201,8 @@ The time complexity is $O(2^n)$, and the space complexity is $O(n)$. Here, $n$ i
+#### Python3
+
```python
class Solution:
def hanota(self, A: List[int], B: List[int], C: List[int]) -> None:
@@ -203,6 +217,8 @@ class Solution:
stk.append((n - 1, a, c, b))
```
+#### Java
+
```java
class Solution {
public void hanota(List A, List B, List C) {
@@ -240,6 +256,8 @@ class Task {
}
```
+#### C++
+
```cpp
struct Task {
int n;
@@ -269,6 +287,8 @@ public:
};
```
+#### Go
+
```go
func hanota(A []int, B []int, C []int) []int {
stk := []Task{{len(A), &A, &B, &C}}
@@ -293,6 +313,8 @@ type Task struct {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify C in-place instead.
diff --git a/lcci/08.07.Permutation I/README.md b/lcci/08.07.Permutation I/README.md
index ddbbf5bf17eff..34a783fde5bac 100644
--- a/lcci/08.07.Permutation I/README.md
+++ b/lcci/08.07.Permutation I/README.md
@@ -51,6 +51,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.07.Permutation%20I
+#### Python3
+
```python
class Solution:
def permutation(self, S: str) -> List[str]:
@@ -75,6 +77,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private char[] s;
@@ -107,6 +111,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -137,6 +143,8 @@ public:
};
```
+#### Go
+
```go
func permutation(S string) (ans []string) {
t := []byte{}
@@ -163,6 +171,8 @@ func permutation(S string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function permutation(S: string): string[] {
const n = S.length;
@@ -190,6 +200,8 @@ function permutation(S: string): string[] {
}
```
+#### JavaScript
+
```js
/**
* @param {string} S
@@ -221,6 +233,8 @@ var permutation = function (S) {
};
```
+#### Swift
+
```swift
class Solution {
private var s: [Character] = []
diff --git a/lcci/08.07.Permutation I/README_EN.md b/lcci/08.07.Permutation I/README_EN.md
index 99a66119532b0..fee5a04b2e71d 100644
--- a/lcci/08.07.Permutation I/README_EN.md
+++ b/lcci/08.07.Permutation I/README_EN.md
@@ -57,6 +57,8 @@ The time complexity is $O(n \times n!)$, where $n$ is the length of the string.
+#### Python3
+
```python
class Solution:
def permutation(self, S: str) -> List[str]:
@@ -81,6 +83,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private char[] s;
@@ -113,6 +117,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -143,6 +149,8 @@ public:
};
```
+#### Go
+
```go
func permutation(S string) (ans []string) {
t := []byte{}
@@ -169,6 +177,8 @@ func permutation(S string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function permutation(S: string): string[] {
const n = S.length;
@@ -196,6 +206,8 @@ function permutation(S: string): string[] {
}
```
+#### JavaScript
+
```js
/**
* @param {string} S
@@ -227,6 +239,8 @@ var permutation = function (S) {
};
```
+#### Swift
+
```swift
class Solution {
private var s: [Character] = []
diff --git a/lcci/08.08.Permutation II/README.md b/lcci/08.08.Permutation II/README.md
index 2e931fc0a7bd4..90b72d44fb2f1 100644
--- a/lcci/08.08.Permutation II/README.md
+++ b/lcci/08.08.Permutation II/README.md
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.08.Permutation%20I
+#### Python3
+
```python
class Solution:
def permutation(self, S: str) -> List[str]:
@@ -74,6 +76,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private int n;
@@ -110,6 +114,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -142,6 +148,8 @@ public:
};
```
+#### Go
+
```go
func permutation(S string) (ans []string) {
cs := []byte(S)
@@ -171,6 +179,8 @@ func permutation(S string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function permutation(S: string): string[] {
const cs: string[] = S.split('').sort();
@@ -199,6 +209,8 @@ function permutation(S: string): string[] {
}
```
+#### JavaScript
+
```js
/**
* @param {string} S
@@ -231,6 +243,8 @@ var permutation = function (S) {
};
```
+#### Swift
+
```swift
class Solution {
private var n: Int = 0
diff --git a/lcci/08.08.Permutation II/README_EN.md b/lcci/08.08.Permutation II/README_EN.md
index df0cf919b181e..d2d10fe8e2414 100644
--- a/lcci/08.08.Permutation II/README_EN.md
+++ b/lcci/08.08.Permutation II/README_EN.md
@@ -58,6 +58,8 @@ The time complexity is $O(n \times n!)$, and the space complexity is $O(n)$. Her
+#### Python3
+
```python
class Solution:
def permutation(self, S: str) -> List[str]:
@@ -82,6 +84,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private int n;
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -150,6 +156,8 @@ public:
};
```
+#### Go
+
```go
func permutation(S string) (ans []string) {
cs := []byte(S)
@@ -179,6 +187,8 @@ func permutation(S string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function permutation(S: string): string[] {
const cs: string[] = S.split('').sort();
@@ -207,6 +217,8 @@ function permutation(S: string): string[] {
}
```
+#### JavaScript
+
```js
/**
* @param {string} S
@@ -239,6 +251,8 @@ var permutation = function (S) {
};
```
+#### Swift
+
```swift
class Solution {
private var n: Int = 0
diff --git a/lcci/08.09.Bracket/README.md b/lcci/08.09.Bracket/README.md
index 2867c6611b92d..6e4a46e5769b9 100644
--- a/lcci/08.09.Bracket/README.md
+++ b/lcci/08.09.Bracket/README.md
@@ -51,6 +51,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.09.Bracket/README.
+#### Python3
+
```python
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
@@ -68,6 +70,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List ans = new ArrayList<>();
@@ -93,6 +97,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -114,6 +120,8 @@ public:
};
```
+#### Go
+
```go
func generateParenthesis(n int) []string {
ans := []string{}
@@ -134,6 +142,8 @@ func generateParenthesis(n int) []string {
}
```
+#### TypeScript
+
```ts
function generateParenthesis(n: number): string[] {
function dfs(l, r, t) {
@@ -153,6 +163,8 @@ function generateParenthesis(n: number): string[] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(left: i32, right: i32, s: &mut String, res: &mut Vec) {
@@ -180,6 +192,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -203,6 +217,8 @@ var generateParenthesis = function (n) {
};
```
+#### Swift
+
```swift
class Solution {
private var ans: [String] = []
diff --git a/lcci/08.09.Bracket/README_EN.md b/lcci/08.09.Bracket/README_EN.md
index 346812aef2c47..295bd24efe68f 100644
--- a/lcci/08.09.Bracket/README_EN.md
+++ b/lcci/08.09.Bracket/README_EN.md
@@ -59,6 +59,8 @@ The time complexity is $O(2^{n\times 2} \times n)$, and the space complexity is
+#### Python3
+
```python
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
@@ -76,6 +78,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List ans = new ArrayList<>();
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -122,6 +128,8 @@ public:
};
```
+#### Go
+
```go
func generateParenthesis(n int) []string {
ans := []string{}
@@ -142,6 +150,8 @@ func generateParenthesis(n int) []string {
}
```
+#### TypeScript
+
```ts
function generateParenthesis(n: number): string[] {
function dfs(l, r, t) {
@@ -161,6 +171,8 @@ function generateParenthesis(n: number): string[] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(left: i32, right: i32, s: &mut String, res: &mut Vec) {
@@ -188,6 +200,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -211,6 +225,8 @@ var generateParenthesis = function (n) {
};
```
+#### Swift
+
```swift
class Solution {
private var ans: [String] = []
diff --git a/lcci/08.10.Color Fill/README.md b/lcci/08.10.Color Fill/README.md
index 21a0d7920210c..d500fcab5b29e 100644
--- a/lcci/08.10.Color Fill/README.md
+++ b/lcci/08.10.Color Fill/README.md
@@ -52,6 +52,8 @@ sr = 1, sc = 1, newColor = 2
+#### Python3
+
```python
class Solution:
def floodFill(
@@ -76,6 +78,8 @@ class Solution:
return image
```
+#### Java
+
```java
class Solution {
private int[] dirs = {-1, 0, 1, 0, -1};
@@ -104,6 +108,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {
oc := image[sr][sc]
@@ -146,6 +154,8 @@ func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {
}
```
+#### TypeScript
+
```ts
function floodFill(image: number[][], sr: number, sc: number, newColor: number): number[][] {
const dfs = (i: number, j: number): void => {
@@ -172,6 +182,8 @@ function floodFill(image: number[][], sr: number, sc: number, newColor: number):
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(i: usize, j: usize, target: i32, new_color: i32, image: &mut Vec>) {
@@ -205,6 +217,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
private var dirs = [-1, 0, 1, 0, -1]
@@ -246,6 +260,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def floodFill(
@@ -267,6 +283,8 @@ class Solution:
return image
```
+#### Java
+
```java
class Solution {
public int[][] floodFill(int[][] image, int sr, int sc, int newColor) {
@@ -295,6 +313,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -322,6 +342,8 @@ public:
};
```
+#### Go
+
```go
func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {
if image[sr][sc] == newColor {
@@ -346,6 +368,8 @@ func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {
}
```
+#### TypeScript
+
```ts
function floodFill(image: number[][], sr: number, sc: number, newColor: number): number[][] {
if (image[sr][sc] === newColor) {
diff --git a/lcci/08.10.Color Fill/README_EN.md b/lcci/08.10.Color Fill/README_EN.md
index 5f42b53f4527f..ec9be4429271c 100644
--- a/lcci/08.10.Color Fill/README_EN.md
+++ b/lcci/08.10.Color Fill/README_EN.md
@@ -60,6 +60,8 @@ The time complexity is $O(m \times n)$, and the space complexity is $O(m \times
+#### Python3
+
```python
class Solution:
def floodFill(
@@ -84,6 +86,8 @@ class Solution:
return image
```
+#### Java
+
```java
class Solution {
private int[] dirs = {-1, 0, 1, 0, -1};
@@ -112,6 +116,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -134,6 +140,8 @@ public:
};
```
+#### Go
+
```go
func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {
oc := image[sr][sc]
@@ -154,6 +162,8 @@ func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {
}
```
+#### TypeScript
+
```ts
function floodFill(image: number[][], sr: number, sc: number, newColor: number): number[][] {
const dfs = (i: number, j: number): void => {
@@ -180,6 +190,8 @@ function floodFill(image: number[][], sr: number, sc: number, newColor: number):
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(i: usize, j: usize, target: i32, new_color: i32, image: &mut Vec>) {
@@ -213,6 +225,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
private var dirs = [-1, 0, 1, 0, -1]
@@ -254,6 +268,8 @@ The time complexity is $O(m \times n)$, and the space complexity is $O(m \times
+#### Python3
+
```python
class Solution:
def floodFill(
@@ -275,6 +291,8 @@ class Solution:
return image
```
+#### Java
+
```java
class Solution {
public int[][] floodFill(int[][] image, int sr, int sc, int newColor) {
@@ -303,6 +321,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -330,6 +350,8 @@ public:
};
```
+#### Go
+
```go
func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {
if image[sr][sc] == newColor {
@@ -354,6 +376,8 @@ func floodFill(image [][]int, sr int, sc int, newColor int) [][]int {
}
```
+#### TypeScript
+
```ts
function floodFill(image: number[][], sr: number, sc: number, newColor: number): number[][] {
if (image[sr][sc] === newColor) {
diff --git a/lcci/08.11.Coin/README.md b/lcci/08.11.Coin/README.md
index 546e5d81c2bdc..66b7fb350e3da 100644
--- a/lcci/08.11.Coin/README.md
+++ b/lcci/08.11.Coin/README.md
@@ -78,6 +78,8 @@ $$
+#### Python3
+
```python
class Solution:
def waysToChange(self, n: int) -> int:
@@ -93,6 +95,8 @@ class Solution:
return f[-1][n]
```
+#### Java
+
```java
class Solution {
public int waysToChange(int n) {
@@ -113,6 +117,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -135,6 +141,8 @@ public:
};
```
+#### Go
+
```go
func waysToChange(n int) int {
const mod int = 1e9 + 7
@@ -156,6 +164,8 @@ func waysToChange(n int) int {
}
```
+#### TypeScript
+
```ts
function waysToChange(n: number): number {
const mod = 10 ** 9 + 7;
@@ -174,6 +184,8 @@ function waysToChange(n: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func waysToChange(_ n: Int) -> Int {
@@ -207,6 +219,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def waysToChange(self, n: int) -> int:
@@ -219,6 +233,8 @@ class Solution:
return f[n]
```
+#### Java
+
```java
class Solution {
public int waysToChange(int n) {
@@ -236,6 +252,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -255,6 +273,8 @@ public:
};
```
+#### Go
+
```go
func waysToChange(n int) int {
const mod int = 1e9 + 7
@@ -270,6 +290,8 @@ func waysToChange(n int) int {
}
```
+#### TypeScript
+
```ts
function waysToChange(n: number): number {
const mod = 10 ** 9 + 7;
diff --git a/lcci/08.11.Coin/README_EN.md b/lcci/08.11.Coin/README_EN.md
index f959382a71a09..2723728769cfb 100644
--- a/lcci/08.11.Coin/README_EN.md
+++ b/lcci/08.11.Coin/README_EN.md
@@ -91,6 +91,8 @@ The time complexity is $O(C \times n)$, and the space complexity is $O(C \times
+#### Python3
+
```python
class Solution:
def waysToChange(self, n: int) -> int:
@@ -106,6 +108,8 @@ class Solution:
return f[-1][n]
```
+#### Java
+
```java
class Solution {
public int waysToChange(int n) {
@@ -126,6 +130,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -148,6 +154,8 @@ public:
};
```
+#### Go
+
```go
func waysToChange(n int) int {
const mod int = 1e9 + 7
@@ -169,6 +177,8 @@ func waysToChange(n int) int {
}
```
+#### TypeScript
+
```ts
function waysToChange(n: number): number {
const mod = 10 ** 9 + 7;
@@ -187,6 +197,8 @@ function waysToChange(n: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func waysToChange(_ n: Int) -> Int {
@@ -220,6 +232,8 @@ We notice that the calculation of $f[i][j]$ is only related to $f[i−1][..]$. T
+#### Python3
+
```python
class Solution:
def waysToChange(self, n: int) -> int:
@@ -232,6 +246,8 @@ class Solution:
return f[n]
```
+#### Java
+
```java
class Solution {
public int waysToChange(int n) {
@@ -249,6 +265,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -268,6 +286,8 @@ public:
};
```
+#### Go
+
```go
func waysToChange(n int) int {
const mod int = 1e9 + 7
@@ -283,6 +303,8 @@ func waysToChange(n int) int {
}
```
+#### TypeScript
+
```ts
function waysToChange(n: number): number {
const mod = 10 ** 9 + 7;
diff --git a/lcci/08.12.Eight Queens/README.md b/lcci/08.12.Eight Queens/README.md
index b3b80d4580434..40aea759ca671 100644
--- a/lcci/08.12.Eight Queens/README.md
+++ b/lcci/08.12.Eight Queens/README.md
@@ -58,6 +58,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.12.Eight%20Queens/
+#### Python3
+
```python
class Solution:
def solveNQueens(self, n: int) -> List[List[str]]:
@@ -82,6 +84,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -126,6 +130,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -156,6 +162,8 @@ public:
};
```
+#### Go
+
```go
func solveNQueens(n int) (ans [][]string) {
col := make([]int, n)
@@ -193,6 +201,8 @@ func solveNQueens(n int) (ans [][]string) {
}
```
+#### TypeScript
+
```ts
function solveNQueens(n: number): string[][] {
const col: number[] = Array(n).fill(0);
@@ -220,6 +230,8 @@ function solveNQueens(n: number): string[][] {
}
```
+#### C#
+
```cs
public class Solution {
private int n;
@@ -259,6 +271,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
private var ans: [[String]] = []
diff --git a/lcci/08.12.Eight Queens/README_EN.md b/lcci/08.12.Eight Queens/README_EN.md
index 9fd549cb8356e..79e8fa1769f8d 100644
--- a/lcci/08.12.Eight Queens/README_EN.md
+++ b/lcci/08.12.Eight Queens/README_EN.md
@@ -74,6 +74,8 @@ The time complexity is $O(n^2 \times n!)$, and the space complexity is $O(n)$. H
+#### Python3
+
```python
class Solution:
def solveNQueens(self, n: int) -> List[List[str]]:
@@ -98,6 +100,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -142,6 +146,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -172,6 +178,8 @@ public:
};
```
+#### Go
+
```go
func solveNQueens(n int) (ans [][]string) {
col := make([]int, n)
@@ -209,6 +217,8 @@ func solveNQueens(n int) (ans [][]string) {
}
```
+#### TypeScript
+
```ts
function solveNQueens(n: number): string[][] {
const col: number[] = Array(n).fill(0);
@@ -236,6 +246,8 @@ function solveNQueens(n: number): string[][] {
}
```
+#### C#
+
```cs
public class Solution {
private int n;
@@ -275,6 +287,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
private var ans: [[String]] = []
diff --git a/lcci/08.13.Pile Box/README.md b/lcci/08.13.Pile Box/README.md
index b21ff7e0afbf4..06420bdf43f82 100644
--- a/lcci/08.13.Pile Box/README.md
+++ b/lcci/08.13.Pile Box/README.md
@@ -47,6 +47,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.13.Pile%20Box/READ
+#### Python3
+
```python
class Solution:
def pileBox(self, box: List[List[int]]) -> int:
@@ -61,6 +63,8 @@ class Solution:
return max(f)
```
+#### Java
+
```java
class Solution {
public int pileBox(int[][] box) {
@@ -82,6 +86,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -105,6 +111,8 @@ public:
};
```
+#### Go
+
```go
func pileBox(box [][]int) int {
sort.Slice(box, func(i, j int) bool {
@@ -125,6 +133,8 @@ func pileBox(box [][]int) int {
}
```
+#### TypeScript
+
```ts
function pileBox(box: number[][]): number {
box.sort((a, b) => (a[0] === b[0] ? b[1] - a[1] : a[0] - b[0]));
@@ -144,6 +154,8 @@ function pileBox(box: number[][]): number {
}
```
+#### Swift
+
```swift
class Solution {
func pileBox(_ box: [[Int]]) -> Int {
diff --git a/lcci/08.13.Pile Box/README_EN.md b/lcci/08.13.Pile Box/README_EN.md
index 4533a278bc32c..1134427558558 100644
--- a/lcci/08.13.Pile Box/README_EN.md
+++ b/lcci/08.13.Pile Box/README_EN.md
@@ -55,6 +55,8 @@ The time complexity is $O(n^2)$, and the space complexity is $O(n)$. Here, $n$ i
+#### Python3
+
```python
class Solution:
def pileBox(self, box: List[List[int]]) -> int:
@@ -69,6 +71,8 @@ class Solution:
return max(f)
```
+#### Java
+
```java
class Solution {
public int pileBox(int[][] box) {
@@ -90,6 +94,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -113,6 +119,8 @@ public:
};
```
+#### Go
+
```go
func pileBox(box [][]int) int {
sort.Slice(box, func(i, j int) bool {
@@ -133,6 +141,8 @@ func pileBox(box [][]int) int {
}
```
+#### TypeScript
+
```ts
function pileBox(box: number[][]): number {
box.sort((a, b) => (a[0] === b[0] ? b[1] - a[1] : a[0] - b[0]));
@@ -152,6 +162,8 @@ function pileBox(box: number[][]): number {
}
```
+#### Swift
+
```swift
class Solution {
func pileBox(_ box: [[Int]]) -> Int {
diff --git a/lcci/08.14.Boolean Evaluation/README.md b/lcci/08.14.Boolean Evaluation/README.md
index 13d81cd01e872..7be5a05182a85 100644
--- a/lcci/08.14.Boolean Evaluation/README.md
+++ b/lcci/08.14.Boolean Evaluation/README.md
@@ -48,6 +48,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.14.Boolean%20Evalu
+#### Python3
+
```python
class Solution:
def countEval(self, s: str, result: int) -> int:
@@ -75,6 +77,8 @@ class Solution:
return ans[result] if 0 <= result < 2 else 0
```
+#### Java
+
```java
class Solution {
private Map memo;
@@ -120,6 +124,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -160,6 +166,8 @@ public:
};
```
+#### Go
+
```go
func countEval(s string, result int) int {
memo := map[string][]int{}
@@ -203,6 +211,8 @@ func countEval(s string, result int) int {
}
```
+#### Swift
+
```swift
class Solution {
private var memo = [String: [Int]]()
diff --git a/lcci/08.14.Boolean Evaluation/README_EN.md b/lcci/08.14.Boolean Evaluation/README_EN.md
index b6716e98f9df5..ea02db7cbc036 100644
--- a/lcci/08.14.Boolean Evaluation/README_EN.md
+++ b/lcci/08.14.Boolean Evaluation/README_EN.md
@@ -60,6 +60,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/08.14.Boolean%20Evalu
+#### Python3
+
```python
class Solution:
def countEval(self, s: str, result: int) -> int:
@@ -87,6 +89,8 @@ class Solution:
return ans[result] if 0 <= result < 2 else 0
```
+#### Java
+
```java
class Solution {
private Map memo;
@@ -132,6 +136,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -172,6 +178,8 @@ public:
};
```
+#### Go
+
```go
func countEval(s string, result int) int {
memo := map[string][]int{}
@@ -215,6 +223,8 @@ func countEval(s string, result int) int {
}
```
+#### Swift
+
```swift
class Solution {
private var memo = [String: [Int]]()
diff --git a/lcci/10.01.Sorted Merge/README.md b/lcci/10.01.Sorted Merge/README.md
index ca4b516acdd63..2a80ac4dffb00 100644
--- a/lcci/10.01.Sorted Merge/README.md
+++ b/lcci/10.01.Sorted Merge/README.md
@@ -46,6 +46,8 @@ B = [2,5,6], n = 3
+#### Python3
+
```python
class Solution:
def merge(self, A: List[int], m: int, B: List[int], n: int) -> None:
@@ -59,6 +61,8 @@ class Solution:
j -= 1
```
+#### Java
+
```java
class Solution {
public void merge(int[] A, int m, int[] B, int n) {
@@ -74,6 +78,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -90,6 +96,8 @@ public:
};
```
+#### Go
+
```go
func merge(A []int, m int, B []int, n int) {
i, j := m-1, n-1
@@ -105,6 +113,8 @@ func merge(A []int, m int, B []int, n int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify A in-place instead.
@@ -121,6 +131,8 @@ function merge(A: number[], m: number, B: number[], n: number): void {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn merge(a: &mut Vec, m: i32, b: &mut Vec, n: i32) {
@@ -138,6 +150,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} A
@@ -158,6 +172,8 @@ var merge = function (A, m, B, n) {
};
```
+#### Swift
+
```swift
class Solution {
func merge(_ A: inout [Int], _ m: Int, _ B: [Int], _ n: Int) {
diff --git a/lcci/10.01.Sorted Merge/README_EN.md b/lcci/10.01.Sorted Merge/README_EN.md
index c86e7cf9a93a9..6b4b13b2c4d80 100644
--- a/lcci/10.01.Sorted Merge/README_EN.md
+++ b/lcci/10.01.Sorted Merge/README_EN.md
@@ -46,6 +46,8 @@ The time complexity is $O(m + n)$, and the space complexity is $O(1)$.
+#### Python3
+
```python
class Solution:
def merge(self, A: List[int], m: int, B: List[int], n: int) -> None:
@@ -59,6 +61,8 @@ class Solution:
j -= 1
```
+#### Java
+
```java
class Solution {
public void merge(int[] A, int m, int[] B, int n) {
@@ -74,6 +78,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -90,6 +96,8 @@ public:
};
```
+#### Go
+
```go
func merge(A []int, m int, B []int, n int) {
i, j := m-1, n-1
@@ -105,6 +113,8 @@ func merge(A []int, m int, B []int, n int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify A in-place instead.
@@ -121,6 +131,8 @@ function merge(A: number[], m: number, B: number[], n: number): void {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn merge(a: &mut Vec, m: i32, b: &mut Vec, n: i32) {
@@ -138,6 +150,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} A
@@ -158,6 +172,8 @@ var merge = function (A, m, B, n) {
};
```
+#### Swift
+
```swift
class Solution {
func merge(_ A: inout [Int], _ m: Int, _ B: [Int], _ n: Int) {
diff --git a/lcci/10.02.Group Anagrams/README.md b/lcci/10.02.Group Anagrams/README.md
index a0c7ee16ad373..d40d684d17dcb 100644
--- a/lcci/10.02.Group Anagrams/README.md
+++ b/lcci/10.02.Group Anagrams/README.md
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/10.02.Group%20Anagram
+#### Python3
+
```python
class Solution:
def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
@@ -71,6 +73,8 @@ class Solution:
return list(d.values())
```
+#### Java
+
```java
class Solution {
public List> groupAnagrams(String[] strs) {
@@ -86,6 +90,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -103,6 +109,8 @@ public:
};
```
+#### Go
+
```go
func groupAnagrams(strs []string) (ans [][]string) {
d := map[string][]string{}
@@ -119,6 +127,8 @@ func groupAnagrams(strs []string) (ans [][]string) {
}
```
+#### TypeScript
+
```ts
function groupAnagrams(strs: string[]): string[][] {
const d: Map = new Map();
@@ -133,6 +143,8 @@ function groupAnagrams(strs: string[]): string[][] {
}
```
+#### Swift
+
```swift
class Solution {
func groupAnagrams(_ strs: [String]) -> [[String]] {
@@ -160,6 +172,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
@@ -172,6 +186,8 @@ class Solution:
return list(d.values())
```
+#### Java
+
```java
class Solution {
public List> groupAnagrams(String[] strs) {
@@ -195,6 +211,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -219,6 +237,8 @@ public:
};
```
+#### Go
+
```go
func groupAnagrams(strs []string) (ans [][]string) {
d := map[[26]int][]string{}
diff --git a/lcci/10.02.Group Anagrams/README_EN.md b/lcci/10.02.Group Anagrams/README_EN.md
index 075bd7d9b8147..65e2091069536 100644
--- a/lcci/10.02.Group Anagrams/README_EN.md
+++ b/lcci/10.02.Group Anagrams/README_EN.md
@@ -69,6 +69,8 @@ The time complexity is $O(n\times k\times \log k)$, where $n$ and $k$ are the le
+#### Python3
+
```python
class Solution:
def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
@@ -79,6 +81,8 @@ class Solution:
return list(d.values())
```
+#### Java
+
```java
class Solution {
public List> groupAnagrams(String[] strs) {
@@ -94,6 +98,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -111,6 +117,8 @@ public:
};
```
+#### Go
+
```go
func groupAnagrams(strs []string) (ans [][]string) {
d := map[string][]string{}
@@ -127,6 +135,8 @@ func groupAnagrams(strs []string) (ans [][]string) {
}
```
+#### TypeScript
+
```ts
function groupAnagrams(strs: string[]): string[][] {
const d: Map = new Map();
@@ -141,6 +151,8 @@ function groupAnagrams(strs: string[]): string[][] {
}
```
+#### Swift
+
```swift
class Solution {
func groupAnagrams(_ strs: [String]) -> [[String]] {
@@ -168,6 +180,8 @@ The time complexity is $O(n\times (k + C))$. Where $n$ and $k$ are the length of
+#### Python3
+
```python
class Solution:
def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
@@ -180,6 +194,8 @@ class Solution:
return list(d.values())
```
+#### Java
+
```java
class Solution {
public List> groupAnagrams(String[] strs) {
@@ -203,6 +219,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -227,6 +245,8 @@ public:
};
```
+#### Go
+
```go
func groupAnagrams(strs []string) (ans [][]string) {
d := map[[26]int][]string{}
diff --git a/lcci/10.03.Search Rotate Array/README.md b/lcci/10.03.Search Rotate Array/README.md
index 47eb5d20f3441..a80c36a16293b 100644
--- a/lcci/10.03.Search Rotate Array/README.md
+++ b/lcci/10.03.Search Rotate Array/README.md
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/10.03.Search%20Rotate
+#### Python3
+
```python
class Solution:
def search(self, arr: List[int], target: int) -> int:
@@ -79,6 +81,8 @@ class Solution:
return l if arr[l] == target else -1
```
+#### Java
+
```java
class Solution {
public int search(int[] arr, int target) {
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -140,6 +146,8 @@ public:
};
```
+#### Go
+
```go
func search(arr []int, target int) int {
l, r := 0, len(arr)-1
@@ -171,6 +179,8 @@ func search(arr []int, target int) int {
}
```
+#### TypeScript
+
```ts
function search(arr: number[], target: number): number {
let [l, r] = [0, arr.length - 1];
@@ -199,6 +209,8 @@ function search(arr: number[], target: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func search(_ arr: [Int], _ target: Int) -> Int {
diff --git a/lcci/10.03.Search Rotate Array/README_EN.md b/lcci/10.03.Search Rotate Array/README_EN.md
index d66ce882a9031..5c48384c9e9dd 100644
--- a/lcci/10.03.Search Rotate Array/README_EN.md
+++ b/lcci/10.03.Search Rotate Array/README_EN.md
@@ -64,6 +64,8 @@ Similar problems:
+#### Python3
+
```python
class Solution:
def search(self, arr: List[int], target: int) -> int:
@@ -87,6 +89,8 @@ class Solution:
return l if arr[l] == target else -1
```
+#### Java
+
```java
class Solution {
public int search(int[] arr, int target) {
@@ -117,6 +121,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -148,6 +154,8 @@ public:
};
```
+#### Go
+
```go
func search(arr []int, target int) int {
l, r := 0, len(arr)-1
@@ -179,6 +187,8 @@ func search(arr []int, target int) int {
}
```
+#### TypeScript
+
```ts
function search(arr: number[], target: number): number {
let [l, r] = [0, arr.length - 1];
@@ -207,6 +217,8 @@ function search(arr: number[], target: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func search(_ arr: [Int], _ target: Int) -> Int {
diff --git a/lcci/10.05.Sparse Array Search/README.md b/lcci/10.05.Sparse Array Search/README.md
index 16faabebae118..8680cb3ebb659 100644
--- a/lcci/10.05.Sparse Array Search/README.md
+++ b/lcci/10.05.Sparse Array Search/README.md
@@ -54,6 +54,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/10.05.Sparse%20Array%
+#### Python3
+
```python
class Solution:
def findString(self, words: List[str], s: str) -> int:
@@ -71,6 +73,8 @@ class Solution:
return dfs(0, len(words) - 1)
```
+#### Java
+
```java
class Solution {
public int findString(String[] words, String s) {
@@ -94,6 +98,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -117,6 +123,8 @@ public:
};
```
+#### Go
+
```go
func findString(words []string, s string) int {
var dfs func(i, j int) int
@@ -137,6 +145,8 @@ func findString(words []string, s string) int {
}
```
+#### TypeScript
+
```ts
function findString(words: string[], s: string): number {
const dfs = (i: number, j: number): number => {
@@ -157,6 +167,8 @@ function findString(words: string[], s: string): number {
}
```
+#### Swift
+
```swift
class Solution {
func findString(_ words: [String], _ s: String) -> Int {
diff --git a/lcci/10.05.Sparse Array Search/README_EN.md b/lcci/10.05.Sparse Array Search/README_EN.md
index ac75ef6420f7c..f85641d1e3205 100644
--- a/lcci/10.05.Sparse Array Search/README_EN.md
+++ b/lcci/10.05.Sparse Array Search/README_EN.md
@@ -61,6 +61,8 @@ In the worst case, the time complexity is $O(n \times m)$, and the space complex
+#### Python3
+
```python
class Solution:
def findString(self, words: List[str], s: str) -> int:
@@ -78,6 +80,8 @@ class Solution:
return dfs(0, len(words) - 1)
```
+#### Java
+
```java
class Solution {
public int findString(String[] words, String s) {
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -124,6 +130,8 @@ public:
};
```
+#### Go
+
```go
func findString(words []string, s string) int {
var dfs func(i, j int) int
@@ -144,6 +152,8 @@ func findString(words []string, s string) int {
}
```
+#### TypeScript
+
```ts
function findString(words: string[], s: string): number {
const dfs = (i: number, j: number): number => {
@@ -164,6 +174,8 @@ function findString(words: string[], s: string): number {
}
```
+#### Swift
+
```swift
class Solution {
func findString(_ words: [String], _ s: String) -> Int {
diff --git a/lcci/10.09.Sorted Matrix Search/README.md b/lcci/10.09.Sorted Matrix Search/README.md
index be0f6feac2a78..f1678a642d65f 100644
--- a/lcci/10.09.Sorted Matrix Search/README.md
+++ b/lcci/10.09.Sorted Matrix Search/README.md
@@ -49,6 +49,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/10.09.Sorted%20Matrix
+#### Python3
+
```python
class Solution:
def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
@@ -59,6 +61,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean searchMatrix(int[][] matrix, int target) {
@@ -73,6 +77,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -88,6 +94,8 @@ public:
};
```
+#### Go
+
```go
func searchMatrix(matrix [][]int, target int) bool {
for _, row := range matrix {
@@ -100,6 +108,8 @@ func searchMatrix(matrix [][]int, target int) bool {
}
```
+#### TypeScript
+
```ts
function searchMatrix(matrix: number[][], target: number): boolean {
const n = matrix[0].length;
@@ -122,6 +132,8 @@ function searchMatrix(matrix: number[][], target: number): boolean {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
@@ -149,6 +161,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -176,6 +190,8 @@ var searchMatrix = function (matrix, target) {
};
```
+#### C#
+
```cs
public class Solution {
public bool SearchMatrix(int[][] matrix, int target) {
@@ -190,6 +206,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func searchMatrix(_ matrix: [[Int]], _ target: Int) -> Bool {
@@ -241,6 +259,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
@@ -258,6 +278,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean searchMatrix(int[][] matrix, int target) {
@@ -281,6 +303,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -305,6 +329,8 @@ public:
};
```
+#### Go
+
```go
func searchMatrix(matrix [][]int, target int) bool {
if len(matrix) == 0 {
@@ -326,6 +352,8 @@ func searchMatrix(matrix [][]int, target int) bool {
}
```
+#### TypeScript
+
```ts
function searchMatrix(matrix: number[][], target: number): boolean {
if (matrix.length === 0) {
@@ -347,6 +375,8 @@ function searchMatrix(matrix: number[][], target: number): boolean {
}
```
+#### C#
+
```cs
public class Solution {
public bool SearchMatrix(int[][] matrix, int target) {
diff --git a/lcci/10.09.Sorted Matrix Search/README_EN.md b/lcci/10.09.Sorted Matrix Search/README_EN.md
index 53db16d144955..737900835597c 100644
--- a/lcci/10.09.Sorted Matrix Search/README_EN.md
+++ b/lcci/10.09.Sorted Matrix Search/README_EN.md
@@ -58,6 +58,8 @@ The time complexity is $O(m \times \log n)$, where $m$ and $n$ are the number of
+#### Python3
+
```python
class Solution:
def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
@@ -68,6 +70,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean searchMatrix(int[][] matrix, int target) {
@@ -82,6 +86,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -97,6 +103,8 @@ public:
};
```
+#### Go
+
```go
func searchMatrix(matrix [][]int, target int) bool {
for _, row := range matrix {
@@ -109,6 +117,8 @@ func searchMatrix(matrix [][]int, target int) bool {
}
```
+#### TypeScript
+
```ts
function searchMatrix(matrix: number[][], target: number): boolean {
const n = matrix[0].length;
@@ -131,6 +141,8 @@ function searchMatrix(matrix: number[][], target: number): boolean {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
@@ -158,6 +170,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -185,6 +199,8 @@ var searchMatrix = function (matrix, target) {
};
```
+#### C#
+
```cs
public class Solution {
public bool SearchMatrix(int[][] matrix, int target) {
@@ -199,6 +215,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func searchMatrix(_ matrix: [[Int]], _ target: Int) -> Bool {
@@ -250,6 +268,8 @@ The time complexity is $O(m + n)$, where $m$ and $n$ are the number of rows and
+#### Python3
+
```python
class Solution:
def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
@@ -267,6 +287,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean searchMatrix(int[][] matrix, int target) {
@@ -290,6 +312,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -314,6 +338,8 @@ public:
};
```
+#### Go
+
```go
func searchMatrix(matrix [][]int, target int) bool {
if len(matrix) == 0 {
@@ -335,6 +361,8 @@ func searchMatrix(matrix [][]int, target int) bool {
}
```
+#### TypeScript
+
```ts
function searchMatrix(matrix: number[][], target: number): boolean {
if (matrix.length === 0) {
@@ -356,6 +384,8 @@ function searchMatrix(matrix: number[][], target: number): boolean {
}
```
+#### C#
+
```cs
public class Solution {
public bool SearchMatrix(int[][] matrix, int target) {
diff --git a/lcci/10.10.Rank from Stream/README.md b/lcci/10.10.Rank from Stream/README.md
index 558af39d732b2..15bc77ffb2ad1 100644
--- a/lcci/10.10.Rank from Stream/README.md
+++ b/lcci/10.10.Rank from Stream/README.md
@@ -54,6 +54,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/10.10.Rank%20from%20S
+#### Python3
+
```python
class BinaryIndexedTree:
__slots__ = "n", "c"
@@ -93,6 +95,8 @@ class StreamRank:
# param_2 = obj.getRankOfNumber(x)
```
+#### Java
+
```java
class BinaryIndexedTree {
private int n;
@@ -142,6 +146,8 @@ class StreamRank {
*/
```
+#### C++
+
```cpp
class BinaryIndexedTree {
private:
@@ -193,6 +199,8 @@ private:
*/
```
+#### Go
+
```go
type BinaryIndexedTree struct {
n int
@@ -241,6 +249,8 @@ func (this *StreamRank) GetRankOfNumber(x int) int {
*/
```
+#### TypeScript
+
```ts
class BinaryIndexedTree {
private n: number;
@@ -288,6 +298,8 @@ class StreamRank {
*/
```
+#### Swift
+
```swift
class BinaryIndexedTree {
private var n: Int
diff --git a/lcci/10.10.Rank from Stream/README_EN.md b/lcci/10.10.Rank from Stream/README_EN.md
index b0e334f79ae33..ce6ca713c59b3 100644
--- a/lcci/10.10.Rank from Stream/README_EN.md
+++ b/lcci/10.10.Rank from Stream/README_EN.md
@@ -57,6 +57,8 @@ In terms of time complexity, both the update and query operations of the Binary
+#### Python3
+
```python
class BinaryIndexedTree:
__slots__ = "n", "c"
@@ -96,6 +98,8 @@ class StreamRank:
# param_2 = obj.getRankOfNumber(x)
```
+#### Java
+
```java
class BinaryIndexedTree {
private int n;
@@ -145,6 +149,8 @@ class StreamRank {
*/
```
+#### C++
+
```cpp
class BinaryIndexedTree {
private:
@@ -196,6 +202,8 @@ private:
*/
```
+#### Go
+
```go
type BinaryIndexedTree struct {
n int
@@ -244,6 +252,8 @@ func (this *StreamRank) GetRankOfNumber(x int) int {
*/
```
+#### TypeScript
+
```ts
class BinaryIndexedTree {
private n: number;
@@ -291,6 +301,8 @@ class StreamRank {
*/
```
+#### Swift
+
```swift
class BinaryIndexedTree {
private var n: Int
diff --git a/lcci/10.11.Peaks and Valleys/README.md b/lcci/10.11.Peaks and Valleys/README.md
index 68d92525fb306..507000cd6c420 100644
--- a/lcci/10.11.Peaks and Valleys/README.md
+++ b/lcci/10.11.Peaks and Valleys/README.md
@@ -38,6 +38,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/10.11.Peaks%20and%20V
+#### Python3
+
```python
class Solution:
def wiggleSort(self, nums: List[int]) -> None:
@@ -46,6 +48,8 @@ class Solution:
nums[i : i + 2] = nums[i : i + 2][::-1]
```
+#### Java
+
```java
class Solution {
public void wiggleSort(int[] nums) {
@@ -60,6 +64,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -73,6 +79,8 @@ public:
};
```
+#### Go
+
```go
func wiggleSort(nums []int) {
sort.Ints(nums)
@@ -82,6 +90,8 @@ func wiggleSort(nums []int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify nums in-place instead.
@@ -95,6 +105,8 @@ function wiggleSort(nums: number[]): void {
}
```
+#### Swift
+
```swift
class Solution {
func wiggleSort(_ nums: inout [Int]) {
diff --git a/lcci/10.11.Peaks and Valleys/README_EN.md b/lcci/10.11.Peaks and Valleys/README_EN.md
index 5c1f476c4a93f..2c60312b8bc49 100644
--- a/lcci/10.11.Peaks and Valleys/README_EN.md
+++ b/lcci/10.11.Peaks and Valleys/README_EN.md
@@ -42,6 +42,8 @@ The time complexity is $O(n \times \log n)$, and the space complexity is $O(\log
+#### Python3
+
```python
class Solution:
def wiggleSort(self, nums: List[int]) -> None:
@@ -50,6 +52,8 @@ class Solution:
nums[i : i + 2] = nums[i : i + 2][::-1]
```
+#### Java
+
```java
class Solution {
public void wiggleSort(int[] nums) {
@@ -64,6 +68,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -77,6 +83,8 @@ public:
};
```
+#### Go
+
```go
func wiggleSort(nums []int) {
sort.Ints(nums)
@@ -86,6 +94,8 @@ func wiggleSort(nums []int) {
}
```
+#### TypeScript
+
```ts
/**
Do not return anything, modify nums in-place instead.
@@ -99,6 +109,8 @@ function wiggleSort(nums: number[]): void {
}
```
+#### Swift
+
```swift
class Solution {
func wiggleSort(_ nums: inout [Int]) {
diff --git a/lcci/16.01.Swap Numbers/README.md b/lcci/16.01.Swap Numbers/README.md
index 97f130d6a5336..c73ff5d154929 100644
--- a/lcci/16.01.Swap Numbers/README.md
+++ b/lcci/16.01.Swap Numbers/README.md
@@ -52,6 +52,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.01.Swap%20Numbers/
+#### Python3
+
```python
class Solution:
def swapNumbers(self, numbers: List[int]) -> List[int]:
@@ -61,6 +63,8 @@ class Solution:
return numbers
```
+#### Java
+
```java
class Solution {
public int[] swapNumbers(int[] numbers) {
@@ -72,6 +76,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -84,6 +90,8 @@ public:
};
```
+#### Go
+
```go
func swapNumbers(numbers []int) []int {
numbers[0] ^= numbers[1]
@@ -93,6 +101,8 @@ func swapNumbers(numbers []int) []int {
}
```
+#### TypeScript
+
```ts
function swapNumbers(numbers: number[]): number[] {
numbers[0] ^= numbers[1];
@@ -102,6 +112,8 @@ function swapNumbers(numbers: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func swapNumbers(_ numbers: [Int]) -> [Int] {
diff --git a/lcci/16.01.Swap Numbers/README_EN.md b/lcci/16.01.Swap Numbers/README_EN.md
index 5655fa14d5e04..a788f3f19812c 100644
--- a/lcci/16.01.Swap Numbers/README_EN.md
+++ b/lcci/16.01.Swap Numbers/README_EN.md
@@ -60,6 +60,8 @@ The time complexity is $O(1)$, and the space complexity is $O(1)$.
+#### Python3
+
```python
class Solution:
def swapNumbers(self, numbers: List[int]) -> List[int]:
@@ -69,6 +71,8 @@ class Solution:
return numbers
```
+#### Java
+
```java
class Solution {
public int[] swapNumbers(int[] numbers) {
@@ -80,6 +84,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -92,6 +98,8 @@ public:
};
```
+#### Go
+
```go
func swapNumbers(numbers []int) []int {
numbers[0] ^= numbers[1]
@@ -101,6 +109,8 @@ func swapNumbers(numbers []int) []int {
}
```
+#### TypeScript
+
```ts
function swapNumbers(numbers: number[]): number[] {
numbers[0] ^= numbers[1];
@@ -110,6 +120,8 @@ function swapNumbers(numbers: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func swapNumbers(_ numbers: [Int]) -> [Int] {
diff --git a/lcci/16.02.Words Frequency/README.md b/lcci/16.02.Words Frequency/README.md
index 4b449bf8adcba..96046d7d1dd37 100644
--- a/lcci/16.02.Words Frequency/README.md
+++ b/lcci/16.02.Words Frequency/README.md
@@ -52,6 +52,8 @@ wordsFrequency.get("pen"); //返回1
+#### Python3
+
```python
class WordsFrequency:
def __init__(self, book: List[str]):
@@ -66,6 +68,8 @@ class WordsFrequency:
# param_1 = obj.get(word)
```
+#### Java
+
```java
class WordsFrequency {
private Map cnt = new HashMap<>();
@@ -88,6 +92,8 @@ class WordsFrequency {
*/
```
+#### C++
+
```cpp
class WordsFrequency {
public:
@@ -112,6 +118,8 @@ private:
*/
```
+#### Go
+
```go
type WordsFrequency struct {
cnt map[string]int
@@ -136,6 +144,8 @@ func (this *WordsFrequency) Get(word string) int {
*/
```
+#### TypeScript
+
```ts
class WordsFrequency {
private cnt: Map;
@@ -160,6 +170,8 @@ class WordsFrequency {
*/
```
+#### Rust
+
```rust
use std::collections::HashMap;
struct WordsFrequency {
@@ -189,6 +201,8 @@ impl WordsFrequency {
*/
```
+#### JavaScript
+
```js
/**
* @param {string[]} book
@@ -215,6 +229,8 @@ WordsFrequency.prototype.get = function (word) {
*/
```
+#### Swift
+
```swift
class WordsFrequency {
private var cnt: [String: Int] = [:]
diff --git a/lcci/16.02.Words Frequency/README_EN.md b/lcci/16.02.Words Frequency/README_EN.md
index 7fd1383e59b7c..91b1267402184 100644
--- a/lcci/16.02.Words Frequency/README_EN.md
+++ b/lcci/16.02.Words Frequency/README_EN.md
@@ -66,6 +66,8 @@ In terms of time complexity, the time complexity of initializing the hash table
+#### Python3
+
```python
class WordsFrequency:
def __init__(self, book: List[str]):
@@ -80,6 +82,8 @@ class WordsFrequency:
# param_1 = obj.get(word)
```
+#### Java
+
```java
class WordsFrequency {
private Map cnt = new HashMap<>();
@@ -102,6 +106,8 @@ class WordsFrequency {
*/
```
+#### C++
+
```cpp
class WordsFrequency {
public:
@@ -126,6 +132,8 @@ private:
*/
```
+#### Go
+
```go
type WordsFrequency struct {
cnt map[string]int
@@ -150,6 +158,8 @@ func (this *WordsFrequency) Get(word string) int {
*/
```
+#### TypeScript
+
```ts
class WordsFrequency {
private cnt: Map;
@@ -174,6 +184,8 @@ class WordsFrequency {
*/
```
+#### Rust
+
```rust
use std::collections::HashMap;
struct WordsFrequency {
@@ -203,6 +215,8 @@ impl WordsFrequency {
*/
```
+#### JavaScript
+
```js
/**
* @param {string[]} book
@@ -229,6 +243,8 @@ WordsFrequency.prototype.get = function (word) {
*/
```
+#### Swift
+
```swift
class WordsFrequency {
private var cnt: [String: Int] = [:]
diff --git a/lcci/16.04.Tic-Tac-Toe/README.md b/lcci/16.04.Tic-Tac-Toe/README.md
index c875a7da17378..14030b4c9b70a 100644
--- a/lcci/16.04.Tic-Tac-Toe/README.md
+++ b/lcci/16.04.Tic-Tac-Toe/README.md
@@ -63,6 +63,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.04.Tic-Tac-Toe/REA
+#### Python3
+
```python
class Solution:
def tictactoe(self, board: List[str]) -> str:
@@ -93,6 +95,8 @@ class Solution:
return 'Pending' if has_empty_grid else 'Draw'
```
+#### Java
+
```java
class Solution {
public String tictactoe(String[] board) {
@@ -128,6 +132,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -162,6 +168,8 @@ public:
};
```
+#### Go
+
```go
func tictactoe(board []string) string {
n := len(board)
@@ -206,6 +214,8 @@ func abs(x int) int {
}
```
+#### TypeScript
+
```ts
function tictactoe(board: string[]): string {
const n = board.length;
@@ -243,6 +253,8 @@ function tictactoe(board: string[]): string {
}
```
+#### Swift
+
```swift
class Solution {
func tictactoe(_ board: [String]) -> String {
diff --git a/lcci/16.04.Tic-Tac-Toe/README_EN.md b/lcci/16.04.Tic-Tac-Toe/README_EN.md
index 03a6014775e7d..081de2dbdc2d3 100644
--- a/lcci/16.04.Tic-Tac-Toe/README_EN.md
+++ b/lcci/16.04.Tic-Tac-Toe/README_EN.md
@@ -77,6 +77,8 @@ The time complexity is $O(n^2)$, and the space complexity is $O(n)$, where $n$ i
+#### Python3
+
```python
class Solution:
def tictactoe(self, board: List[str]) -> str:
@@ -107,6 +109,8 @@ class Solution:
return 'Pending' if has_empty_grid else 'Draw'
```
+#### Java
+
```java
class Solution {
public String tictactoe(String[] board) {
@@ -142,6 +146,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -176,6 +182,8 @@ public:
};
```
+#### Go
+
```go
func tictactoe(board []string) string {
n := len(board)
@@ -220,6 +228,8 @@ func abs(x int) int {
}
```
+#### TypeScript
+
```ts
function tictactoe(board: string[]): string {
const n = board.length;
@@ -257,6 +267,8 @@ function tictactoe(board: string[]): string {
}
```
+#### Swift
+
```swift
class Solution {
func tictactoe(_ board: [String]) -> String {
diff --git a/lcci/16.05.Factorial Zeros/README.md b/lcci/16.05.Factorial Zeros/README.md
index 45e61b9b99d0d..6c21b9b64c6c4 100644
--- a/lcci/16.05.Factorial Zeros/README.md
+++ b/lcci/16.05.Factorial Zeros/README.md
@@ -46,6 +46,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.05.Factorial%20Zer
+#### Python3
+
```python
class Solution:
def trailingZeroes(self, n: int) -> int:
@@ -56,6 +58,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int trailingZeroes(int n) {
@@ -69,6 +73,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -83,6 +89,8 @@ public:
};
```
+#### Go
+
```go
func trailingZeroes(n int) int {
ans := 0
@@ -94,6 +102,8 @@ func trailingZeroes(n int) int {
}
```
+#### TypeScript
+
```ts
function trailingZeroes(n: number): number {
let ans = 0;
@@ -105,6 +115,8 @@ function trailingZeroes(n: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func trailingZeroes(_ n: Int) -> Int {
diff --git a/lcci/16.05.Factorial Zeros/README_EN.md b/lcci/16.05.Factorial Zeros/README_EN.md
index 922166ef65d3b..0e26a6c7ac7c9 100644
--- a/lcci/16.05.Factorial Zeros/README_EN.md
+++ b/lcci/16.05.Factorial Zeros/README_EN.md
@@ -56,6 +56,8 @@ The time complexity is $O(\log n)$, and the space complexity is $O(1)$.
+#### Python3
+
```python
class Solution:
def trailingZeroes(self, n: int) -> int:
@@ -66,6 +68,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int trailingZeroes(int n) {
@@ -79,6 +83,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -93,6 +99,8 @@ public:
};
```
+#### Go
+
```go
func trailingZeroes(n int) int {
ans := 0
@@ -104,6 +112,8 @@ func trailingZeroes(n int) int {
}
```
+#### TypeScript
+
```ts
function trailingZeroes(n: number): number {
let ans = 0;
@@ -115,6 +125,8 @@ function trailingZeroes(n: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func trailingZeroes(_ n: Int) -> Int {
diff --git a/lcci/16.06.Smallest Difference/README.md b/lcci/16.06.Smallest Difference/README.md
index 19aeb81a5d9b4..4f6a5d6510376 100644
--- a/lcci/16.06.Smallest Difference/README.md
+++ b/lcci/16.06.Smallest Difference/README.md
@@ -40,6 +40,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.06.Smallest%20Diff
+#### Python3
+
```python
class Solution:
def smallestDifference(self, a: List[int], b: List[int]) -> int:
@@ -55,6 +57,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int smallestDifference(int[] a, int[] b) {
@@ -87,6 +91,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -107,6 +113,8 @@ public:
};
```
+#### Go
+
```go
func smallestDifference(a []int, b []int) int {
sort.Ints(b)
@@ -124,6 +132,8 @@ func smallestDifference(a []int, b []int) int {
}
```
+#### TypeScript
+
```ts
function smallestDifference(a: number[], b: number[]): number {
b.sort((a, b) => a - b);
@@ -153,6 +163,8 @@ function smallestDifference(a: number[], b: number[]): number {
}
```
+#### Swift
+
```swift
class Solution {
func smallestDifference(_ a: [Int], _ b: [Int]) -> Int {
@@ -202,6 +214,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def smallestDifference(self, a: List[int], b: List[int]) -> int:
@@ -218,6 +232,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int smallestDifference(int[] a, int[] b) {
@@ -238,6 +254,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -259,6 +277,8 @@ public:
};
```
+#### Go
+
```go
func smallestDifference(a []int, b []int) int {
sort.Ints(a)
@@ -284,6 +304,8 @@ func abs(a int) int {
}
```
+#### TypeScript
+
```ts
function smallestDifference(a: number[], b: number[]): number {
a.sort((a, b) => a - b);
diff --git a/lcci/16.06.Smallest Difference/README_EN.md b/lcci/16.06.Smallest Difference/README_EN.md
index 6d1cc0cf12433..b9126e42d1c2c 100644
--- a/lcci/16.06.Smallest Difference/README_EN.md
+++ b/lcci/16.06.Smallest Difference/README_EN.md
@@ -48,6 +48,8 @@ The time complexity is $O(n \times \log n)$, and the space complexity is $O(\log
+#### Python3
+
```python
class Solution:
def smallestDifference(self, a: List[int], b: List[int]) -> int:
@@ -63,6 +65,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int smallestDifference(int[] a, int[] b) {
@@ -95,6 +99,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -115,6 +121,8 @@ public:
};
```
+#### Go
+
```go
func smallestDifference(a []int, b []int) int {
sort.Ints(b)
@@ -132,6 +140,8 @@ func smallestDifference(a []int, b []int) int {
}
```
+#### TypeScript
+
```ts
function smallestDifference(a: number[], b: number[]): number {
b.sort((a, b) => a - b);
@@ -161,6 +171,8 @@ function smallestDifference(a: number[], b: number[]): number {
}
```
+#### Swift
+
```swift
class Solution {
func smallestDifference(_ a: [Int], _ b: [Int]) -> Int {
@@ -210,6 +222,8 @@ The time complexity is $O(n \times \log n)$, and the space complexity is $O(\log
+#### Python3
+
```python
class Solution:
def smallestDifference(self, a: List[int], b: List[int]) -> int:
@@ -226,6 +240,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int smallestDifference(int[] a, int[] b) {
@@ -246,6 +262,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -267,6 +285,8 @@ public:
};
```
+#### Go
+
```go
func smallestDifference(a []int, b []int) int {
sort.Ints(a)
@@ -292,6 +312,8 @@ func abs(a int) int {
}
```
+#### TypeScript
+
```ts
function smallestDifference(a: number[], b: number[]): number {
a.sort((a, b) => a - b);
diff --git a/lcci/16.07.Maximum/README.md b/lcci/16.07.Maximum/README.md
index 8ac924d4c9fcf..f31968c9dcd92 100644
--- a/lcci/16.07.Maximum/README.md
+++ b/lcci/16.07.Maximum/README.md
@@ -36,6 +36,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.07.Maximum/README.
+#### Python3
+
```python
class Solution:
def maximum(self, a: int, b: int) -> int:
@@ -43,6 +45,8 @@ class Solution:
return a * (k ^ 1) + b * k
```
+#### Java
+
```java
class Solution {
public int maximum(int a, int b) {
@@ -52,6 +56,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -62,6 +68,8 @@ public:
};
```
+#### Go
+
```go
func maximum(a int, b int) int {
k := (a - b) >> 63 & 1
@@ -69,6 +77,8 @@ func maximum(a int, b int) int {
}
```
+#### TypeScript
+
```ts
function maximum(a: number, b: number): number {
const k: number = Number(((BigInt(a) - BigInt(b)) >> BigInt(63)) & BigInt(1));
@@ -76,6 +86,8 @@ function maximum(a: number, b: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func maximum(_ a: Int, _ b: Int) -> Int {
diff --git a/lcci/16.07.Maximum/README_EN.md b/lcci/16.07.Maximum/README_EN.md
index f06ddd98b4f73..7834f91564349 100644
--- a/lcci/16.07.Maximum/README_EN.md
+++ b/lcci/16.07.Maximum/README_EN.md
@@ -40,6 +40,8 @@ The time complexity is $O(1)$, and the space complexity is $O(1)$.
+#### Python3
+
```python
class Solution:
def maximum(self, a: int, b: int) -> int:
@@ -47,6 +49,8 @@ class Solution:
return a * (k ^ 1) + b * k
```
+#### Java
+
```java
class Solution {
public int maximum(int a, int b) {
@@ -56,6 +60,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -66,6 +72,8 @@ public:
};
```
+#### Go
+
```go
func maximum(a int, b int) int {
k := (a - b) >> 63 & 1
@@ -73,6 +81,8 @@ func maximum(a int, b int) int {
}
```
+#### TypeScript
+
```ts
function maximum(a: number, b: number): number {
const k: number = Number(((BigInt(a) - BigInt(b)) >> BigInt(63)) & BigInt(1));
@@ -80,6 +90,8 @@ function maximum(a: number, b: number): number {
}
```
+#### Swift
+
```swift
class Solution {
func maximum(_ a: Int, _ b: Int) -> Int {
diff --git a/lcci/16.10.Living People/README.md b/lcci/16.10.Living People/README.md
index 38370e6212fe3..6ddcf2a02d402 100644
--- a/lcci/16.10.Living People/README.md
+++ b/lcci/16.10.Living People/README.md
@@ -47,6 +47,8 @@ death = {1948, 1951, 2000}
+#### Python3
+
```python
class Solution:
def maxAliveYear(self, birth: List[int], death: List[int]) -> int:
@@ -65,6 +67,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int maxAliveYear(int[] birth, int[] death) {
@@ -90,6 +94,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -116,6 +122,8 @@ public:
};
```
+#### Go
+
```go
func maxAliveYear(birth []int, death []int) (ans int) {
base := 1900
@@ -138,6 +146,8 @@ func maxAliveYear(birth []int, death []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function maxAliveYear(birth: number[], death: number[]): number {
const base = 1900;
@@ -160,6 +170,8 @@ function maxAliveYear(birth: number[], death: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn max_alive_year(birth: Vec, death: Vec) -> i32 {
@@ -185,6 +197,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func maxAliveYear(_ birth: [Int], _ death: [Int]) -> Int {
diff --git a/lcci/16.10.Living People/README_EN.md b/lcci/16.10.Living People/README_EN.md
index 7ee6f94753314..e2b59d6036a92 100644
--- a/lcci/16.10.Living People/README_EN.md
+++ b/lcci/16.10.Living People/README_EN.md
@@ -57,6 +57,8 @@ The time complexity is $O(n)$, and the space complexity is $O(C)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def maxAliveYear(self, birth: List[int], death: List[int]) -> int:
@@ -75,6 +77,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int maxAliveYear(int[] birth, int[] death) {
@@ -100,6 +104,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
func maxAliveYear(birth []int, death []int) (ans int) {
base := 1900
@@ -148,6 +156,8 @@ func maxAliveYear(birth []int, death []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function maxAliveYear(birth: number[], death: number[]): number {
const base = 1900;
@@ -170,6 +180,8 @@ function maxAliveYear(birth: number[], death: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn max_alive_year(birth: Vec, death: Vec) -> i32 {
@@ -195,6 +207,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func maxAliveYear(_ birth: [Int], _ death: [Int]) -> Int {
diff --git a/lcci/16.11.Diving Board/README.md b/lcci/16.11.Diving Board/README.md
index f741478f2fe4a..7b14f08132e68 100644
--- a/lcci/16.11.Diving Board/README.md
+++ b/lcci/16.11.Diving Board/README.md
@@ -47,6 +47,8 @@ k = 3
+#### Python3
+
```python
class Solution:
def divingBoard(self, shorter: int, longer: int, k: int) -> List[int]:
@@ -60,6 +62,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] divingBoard(int shorter, int longer, int k) {
@@ -78,6 +82,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -92,6 +98,8 @@ public:
};
```
+#### Go
+
```go
func divingBoard(shorter int, longer int, k int) []int {
if k == 0 {
@@ -108,6 +116,8 @@ func divingBoard(shorter int, longer int, k int) []int {
}
```
+#### TypeScript
+
```ts
function divingBoard(shorter: number, longer: number, k: number): number[] {
if (k === 0) {
@@ -124,6 +134,8 @@ function divingBoard(shorter: number, longer: number, k: number): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func divingBoard(_ shorter: Int, _ longer: Int, _ k: Int) -> [Int] {
diff --git a/lcci/16.11.Diving Board/README_EN.md b/lcci/16.11.Diving Board/README_EN.md
index 9b981842a4e68..e6ae95ecbbf12 100644
--- a/lcci/16.11.Diving Board/README_EN.md
+++ b/lcci/16.11.Diving Board/README_EN.md
@@ -59,6 +59,8 @@ The time complexity is $O(k)$, where $k$ is the number of boards. Ignoring the s
+#### Python3
+
```python
class Solution:
def divingBoard(self, shorter: int, longer: int, k: int) -> List[int]:
@@ -72,6 +74,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] divingBoard(int shorter, int longer, int k) {
@@ -90,6 +94,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -104,6 +110,8 @@ public:
};
```
+#### Go
+
```go
func divingBoard(shorter int, longer int, k int) []int {
if k == 0 {
@@ -120,6 +128,8 @@ func divingBoard(shorter int, longer int, k int) []int {
}
```
+#### TypeScript
+
```ts
function divingBoard(shorter: number, longer: number, k: number): number[] {
if (k === 0) {
@@ -136,6 +146,8 @@ function divingBoard(shorter: number, longer: number, k: number): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func divingBoard(_ shorter: Int, _ longer: Int, _ k: Int) -> [Int] {
diff --git a/lcci/16.13.Bisect Squares/README.md b/lcci/16.13.Bisect Squares/README.md
index 60183ecb292ff..01aabba2261b7 100644
--- a/lcci/16.13.Bisect Squares/README.md
+++ b/lcci/16.13.Bisect Squares/README.md
@@ -51,6 +51,8 @@ square2 = {0, -1, 2}
+#### Python3
+
```python
class Solution:
def cutSquares(self, square1: List[int], square2: List[int]) -> List[float]:
@@ -77,6 +79,8 @@ class Solution:
return [x3, y3, x4, y4]
```
+#### Java
+
```java
class Solution {
public double[] cutSquares(int[] square1, int[] square2) {
@@ -111,6 +115,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -146,6 +152,8 @@ public:
};
```
+#### Go
+
```go
func cutSquares(square1 []int, square2 []int) []float64 {
x1, y1 := float64(square1[0])+float64(square1[2])/2, float64(square1[1])+float64(square1[2])/2
@@ -176,6 +184,8 @@ func cutSquares(square1 []int, square2 []int) []float64 {
}
```
+#### TypeScript
+
```ts
function cutSquares(square1: number[], square2: number[]): number[] {
const x1 = square1[0] + square1[2] / 2;
@@ -208,6 +218,8 @@ function cutSquares(square1: number[], square2: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func cutSquares(_ square1: [Int], _ square2: [Int]) -> [Double] {
diff --git a/lcci/16.13.Bisect Squares/README_EN.md b/lcci/16.13.Bisect Squares/README_EN.md
index 8f646ca7adba5..434d35b707dfc 100644
--- a/lcci/16.13.Bisect Squares/README_EN.md
+++ b/lcci/16.13.Bisect Squares/README_EN.md
@@ -58,6 +58,8 @@ The time complexity is $O(1)$, and the space complexity is $O(1)$.
+#### Python3
+
```python
class Solution:
def cutSquares(self, square1: List[int], square2: List[int]) -> List[float]:
@@ -84,6 +86,8 @@ class Solution:
return [x3, y3, x4, y4]
```
+#### Java
+
```java
class Solution {
public double[] cutSquares(int[] square1, int[] square2) {
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -153,6 +159,8 @@ public:
};
```
+#### Go
+
```go
func cutSquares(square1 []int, square2 []int) []float64 {
x1, y1 := float64(square1[0])+float64(square1[2])/2, float64(square1[1])+float64(square1[2])/2
@@ -183,6 +191,8 @@ func cutSquares(square1 []int, square2 []int) []float64 {
}
```
+#### TypeScript
+
```ts
function cutSquares(square1: number[], square2: number[]): number[] {
const x1 = square1[0] + square1[2] / 2;
@@ -215,6 +225,8 @@ function cutSquares(square1: number[], square2: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func cutSquares(_ square1: [Int], _ square2: [Int]) -> [Double] {
diff --git a/lcci/16.14.Best Line/README.md b/lcci/16.14.Best Line/README.md
index 057333c8b3ae5..62e7064c65c56 100644
--- a/lcci/16.14.Best Line/README.md
+++ b/lcci/16.14.Best Line/README.md
@@ -41,6 +41,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.14.Best%20Line/REA
+#### Python3
+
```python
class Solution:
def bestLine(self, points: List[List[int]]) -> List[int]:
@@ -62,6 +64,8 @@ class Solution:
return [x, y]
```
+#### Java
+
```java
class Solution {
public int[] bestLine(int[][] points) {
@@ -93,6 +97,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -123,6 +129,8 @@ public:
};
```
+#### Go
+
```go
func bestLine(points [][]int) []int {
n := len(points)
@@ -151,6 +159,8 @@ func bestLine(points [][]int) []int {
}
```
+#### Swift
+
```swift
class Solution {
func bestLine(_ points: [[Int]]) -> [Int] {
@@ -202,6 +212,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def bestLine(self, points: List[List[int]]) -> List[int]:
@@ -225,6 +237,8 @@ class Solution:
return [x, y]
```
+#### Java
+
```java
class Solution {
public int[] bestLine(int[][] points) {
@@ -259,6 +273,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -290,6 +306,8 @@ public:
};
```
+#### Go
+
```go
func bestLine(points [][]int) []int {
n := len(points)
diff --git a/lcci/16.14.Best Line/README_EN.md b/lcci/16.14.Best Line/README_EN.md
index aac195fab8812..53acd6abd42a2 100644
--- a/lcci/16.14.Best Line/README_EN.md
+++ b/lcci/16.14.Best Line/README_EN.md
@@ -46,6 +46,8 @@ The time complexity is $O(n^3)$, and the space complexity is $O(1)$. Here, $n$ i
+#### Python3
+
```python
class Solution:
def bestLine(self, points: List[List[int]]) -> List[int]:
@@ -67,6 +69,8 @@ class Solution:
return [x, y]
```
+#### Java
+
```java
class Solution {
public int[] bestLine(int[][] points) {
@@ -98,6 +102,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -128,6 +134,8 @@ public:
};
```
+#### Go
+
```go
func bestLine(points [][]int) []int {
n := len(points)
@@ -156,6 +164,8 @@ func bestLine(points [][]int) []int {
}
```
+#### Swift
+
```swift
class Solution {
func bestLine(_ points: [[Int]]) -> [Int] {
@@ -203,6 +213,8 @@ The time complexity is $O(n^2 \times \log m)$, and the space complexity is $O(n)
+#### Python3
+
```python
class Solution:
def bestLine(self, points: List[List[int]]) -> List[int]:
@@ -226,6 +238,8 @@ class Solution:
return [x, y]
```
+#### Java
+
```java
class Solution {
public int[] bestLine(int[][] points) {
@@ -260,6 +274,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -291,6 +307,8 @@ public:
};
```
+#### Go
+
```go
func bestLine(points [][]int) []int {
n := len(points)
diff --git a/lcci/16.15.Master Mind/README.md b/lcci/16.15.Master Mind/README.md
index 4c91527cbb1bb..7f1809906d2e7 100644
--- a/lcci/16.15.Master Mind/README.md
+++ b/lcci/16.15.Master Mind/README.md
@@ -44,6 +44,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.15.Master%20Mind/R
+#### Python3
+
```python
class Solution:
def masterMind(self, solution: str, guess: str) -> List[int]:
@@ -52,6 +54,8 @@ class Solution:
return [x, y - x]
```
+#### Java
+
```java
class Solution {
public int[] masterMind(String solution, String guess) {
@@ -72,6 +76,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -90,6 +96,8 @@ public:
};
```
+#### Go
+
```go
func masterMind(solution string, guess string) []int {
var x, y int
@@ -110,6 +118,8 @@ func masterMind(solution string, guess string) []int {
}
```
+#### JavaScript
+
```js
/**
* @param {string} solution
@@ -135,6 +145,8 @@ var masterMind = function (solution, guess) {
};
```
+#### Swift
+
```swift
class Solution {
func masterMind(_ solution: String, _ guess: String) -> [Int] {
diff --git a/lcci/16.15.Master Mind/README_EN.md b/lcci/16.15.Master Mind/README_EN.md
index d7a80f1ff47bb..540452da456e4 100644
--- a/lcci/16.15.Master Mind/README_EN.md
+++ b/lcci/16.15.Master Mind/README_EN.md
@@ -52,6 +52,8 @@ The time complexity is $O(C)$, and the space complexity is $O(C)$. Here, $C=4$ f
+#### Python3
+
```python
class Solution:
def masterMind(self, solution: str, guess: str) -> List[int]:
@@ -60,6 +62,8 @@ class Solution:
return [x, y - x]
```
+#### Java
+
```java
class Solution {
public int[] masterMind(String solution, String guess) {
@@ -80,6 +84,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -98,6 +104,8 @@ public:
};
```
+#### Go
+
```go
func masterMind(solution string, guess string) []int {
var x, y int
@@ -118,6 +126,8 @@ func masterMind(solution string, guess string) []int {
}
```
+#### JavaScript
+
```js
/**
* @param {string} solution
@@ -143,6 +153,8 @@ var masterMind = function (solution, guess) {
};
```
+#### Swift
+
```swift
class Solution {
func masterMind(_ solution: String, _ guess: String) -> [Int] {
diff --git a/lcci/16.16.Sub Sort/README.md b/lcci/16.16.Sub Sort/README.md
index 4453caf9a613c..3c50c224ffa77 100644
--- a/lcci/16.16.Sub Sort/README.md
+++ b/lcci/16.16.Sub Sort/README.md
@@ -42,6 +42,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.16.Sub%20Sort/READ
+#### Python3
+
```python
class Solution:
def subSort(self, array: List[int]) -> List[int]:
@@ -61,6 +63,8 @@ class Solution:
return [left, right]
```
+#### Java
+
```java
class Solution {
public int[] subSort(int[] array) {
@@ -86,6 +90,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -112,6 +118,8 @@ public:
};
```
+#### Go
+
```go
func subSort(array []int) []int {
n := len(array)
@@ -135,6 +143,8 @@ func subSort(array []int) []int {
}
```
+#### TypeScript
+
```ts
function subSort(array: number[]): number[] {
const n = array.length;
@@ -158,6 +168,8 @@ function subSort(array: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func subSort(_ array: [Int]) -> [Int] {
diff --git a/lcci/16.16.Sub Sort/README_EN.md b/lcci/16.16.Sub Sort/README_EN.md
index b235ea8b5c56f..46bc5feaf8d39 100644
--- a/lcci/16.16.Sub Sort/README_EN.md
+++ b/lcci/16.16.Sub Sort/README_EN.md
@@ -47,6 +47,8 @@ The time complexity is $O(n)$, where $n$ is the length of the array $array$. The
+#### Python3
+
```python
class Solution:
def subSort(self, array: List[int]) -> List[int]:
@@ -66,6 +68,8 @@ class Solution:
return [left, right]
```
+#### Java
+
```java
class Solution {
public int[] subSort(int[] array) {
@@ -91,6 +95,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -117,6 +123,8 @@ public:
};
```
+#### Go
+
```go
func subSort(array []int) []int {
n := len(array)
@@ -140,6 +148,8 @@ func subSort(array []int) []int {
}
```
+#### TypeScript
+
```ts
function subSort(array: number[]): number[] {
const n = array.length;
@@ -163,6 +173,8 @@ function subSort(array: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func subSort(_ array: [Int]) -> [Int] {
diff --git a/lcci/16.17.Contiguous Sequence/README.md b/lcci/16.17.Contiguous Sequence/README.md
index b99e31b9438a5..654b1462ed592 100644
--- a/lcci/16.17.Contiguous Sequence/README.md
+++ b/lcci/16.17.Contiguous Sequence/README.md
@@ -51,6 +51,8 @@ $$
+#### Python3
+
```python
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
@@ -61,6 +63,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int maxSubArray(int[] nums) {
@@ -74,6 +78,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -88,6 +94,8 @@ public:
};
```
+#### Go
+
```go
func maxSubArray(nums []int) int {
ans, f := math.MinInt32, math.MinInt32
@@ -99,6 +107,8 @@ func maxSubArray(nums []int) int {
}
```
+#### TypeScript
+
```ts
function maxSubArray(nums: number[]): number {
let [ans, f] = [-Infinity, -Infinity];
@@ -110,6 +120,8 @@ function maxSubArray(nums: number[]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -125,6 +137,8 @@ var maxSubArray = function (nums) {
};
```
+#### Swift
+
```swift
class Solution {
func maxSubArray(_ nums: [Int]) -> Int {
diff --git a/lcci/16.17.Contiguous Sequence/README_EN.md b/lcci/16.17.Contiguous Sequence/README_EN.md
index cdcb3bcf4f5ba..cb6d2a9acaf0a 100644
--- a/lcci/16.17.Contiguous Sequence/README_EN.md
+++ b/lcci/16.17.Contiguous Sequence/README_EN.md
@@ -64,6 +64,8 @@ We notice that $f[i]$ only depends on $f[i-1]$, so we can use a variable $f$ to
+#### Python3
+
```python
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
@@ -74,6 +76,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int maxSubArray(int[] nums) {
@@ -87,6 +91,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -101,6 +107,8 @@ public:
};
```
+#### Go
+
```go
func maxSubArray(nums []int) int {
ans, f := math.MinInt32, math.MinInt32
@@ -112,6 +120,8 @@ func maxSubArray(nums []int) int {
}
```
+#### TypeScript
+
```ts
function maxSubArray(nums: number[]): number {
let [ans, f] = [-Infinity, -Infinity];
@@ -123,6 +133,8 @@ function maxSubArray(nums: number[]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -138,6 +150,8 @@ var maxSubArray = function (nums) {
};
```
+#### Swift
+
```swift
class Solution {
func maxSubArray(_ nums: [Int]) -> Int {
diff --git a/lcci/16.18.Pattern Matching/README.md b/lcci/16.18.Pattern Matching/README.md
index 34e10dda102ff..7c787b8fdd114 100644
--- a/lcci/16.18.Pattern Matching/README.md
+++ b/lcci/16.18.Pattern Matching/README.md
@@ -59,6 +59,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.18.Pattern%20Match
+#### Python3
+
```python
class Solution:
def patternMatching(self, pattern: str, value: str) -> bool:
@@ -94,6 +96,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
private String pattern;
@@ -150,6 +154,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -209,6 +215,8 @@ public:
};
```
+#### Go
+
```go
func patternMatching(pattern string, value string) bool {
cnt := [2]int{}
@@ -257,6 +265,8 @@ func patternMatching(pattern string, value string) bool {
}
```
+#### TypeScript
+
```ts
function patternMatching(pattern: string, value: string): boolean {
const cnt: number[] = [0, 0];
@@ -304,6 +314,8 @@ function patternMatching(pattern: string, value: string): boolean {
}
```
+#### Swift
+
```swift
class Solution {
private var pattern: String = ""
diff --git a/lcci/16.18.Pattern Matching/README_EN.md b/lcci/16.18.Pattern Matching/README_EN.md
index 4ce63cf4a8c47..5289c97fb75c0 100644
--- a/lcci/16.18.Pattern Matching/README_EN.md
+++ b/lcci/16.18.Pattern Matching/README_EN.md
@@ -76,6 +76,8 @@ The time complexity is $O(n^2)$, and the space complexity is $O(n)$. Here, $n$ i
+#### Python3
+
```python
class Solution:
def patternMatching(self, pattern: str, value: str) -> bool:
@@ -111,6 +113,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
private String pattern;
@@ -167,6 +171,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -226,6 +232,8 @@ public:
};
```
+#### Go
+
```go
func patternMatching(pattern string, value string) bool {
cnt := [2]int{}
@@ -274,6 +282,8 @@ func patternMatching(pattern string, value string) bool {
}
```
+#### TypeScript
+
```ts
function patternMatching(pattern: string, value: string): boolean {
const cnt: number[] = [0, 0];
@@ -321,6 +331,8 @@ function patternMatching(pattern: string, value: string): boolean {
}
```
+#### Swift
+
```swift
class Solution {
private var pattern: String = ""
diff --git a/lcci/16.19.Pond Sizes/README.md b/lcci/16.19.Pond Sizes/README.md
index 11cdf1514a376..66599a5437997 100644
--- a/lcci/16.19.Pond Sizes/README.md
+++ b/lcci/16.19.Pond Sizes/README.md
@@ -49,6 +49,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.19.Pond%20Sizes/RE
+#### Python3
+
```python
class Solution:
def pondSizes(self, land: List[List[int]]) -> List[int]:
@@ -65,6 +67,8 @@ class Solution:
return sorted(dfs(i, j) for i in range(m) for j in range(n) if land[i][j] == 0)
```
+#### Java
+
```java
class Solution {
private int m;
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -132,6 +138,8 @@ public:
};
```
+#### Go
+
```go
func pondSizes(land [][]int) (ans []int) {
m, n := len(land), len(land[0])
@@ -160,6 +168,8 @@ func pondSizes(land [][]int) (ans []int) {
}
```
+#### TypeScript
+
```ts
function pondSizes(land: number[][]): number[] {
const m = land.length;
@@ -189,6 +199,8 @@ function pondSizes(land: number[][]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
private var m: Int = 0
diff --git a/lcci/16.19.Pond Sizes/README_EN.md b/lcci/16.19.Pond Sizes/README_EN.md
index 156f6f269fd02..3f8fdacf45a15 100644
--- a/lcci/16.19.Pond Sizes/README_EN.md
+++ b/lcci/16.19.Pond Sizes/README_EN.md
@@ -63,6 +63,8 @@ The time complexity is $O(m \times n \times \log (m \times n))$, and the space c
+#### Python3
+
```python
class Solution:
def pondSizes(self, land: List[List[int]]) -> List[int]:
@@ -79,6 +81,8 @@ class Solution:
return sorted(dfs(i, j) for i in range(m) for j in range(n) if land[i][j] == 0)
```
+#### Java
+
```java
class Solution {
private int m;
@@ -115,6 +119,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -146,6 +152,8 @@ public:
};
```
+#### Go
+
```go
func pondSizes(land [][]int) (ans []int) {
m, n := len(land), len(land[0])
@@ -174,6 +182,8 @@ func pondSizes(land [][]int) (ans []int) {
}
```
+#### TypeScript
+
```ts
function pondSizes(land: number[][]): number[] {
const m = land.length;
@@ -203,6 +213,8 @@ function pondSizes(land: number[][]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
private var m: Int = 0
diff --git a/lcci/16.20.T9/README.md b/lcci/16.20.T9/README.md
index b26b0a961c227..7f268be4c6e0e 100644
--- a/lcci/16.20.T9/README.md
+++ b/lcci/16.20.T9/README.md
@@ -47,6 +47,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.20.T9/README.md
+#### Python3
+
```python
class Solution:
def getValidT9Words(self, num: str, words: List[str]) -> List[str]:
@@ -57,6 +59,8 @@ class Solution:
return [w for w in words if check(w)]
```
+#### Python3
+
```python
class Solution:
def getValidT9Words(self, num: str, words: List[str]) -> List[str]:
@@ -64,6 +68,8 @@ class Solution:
return [w for w in words if w.translate(trans) == num]
```
+#### Java
+
```java
class Solution {
public List getValidT9Words(String num, String[] words) {
@@ -91,6 +97,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -118,6 +126,8 @@ public:
};
```
+#### Go
+
```go
func getValidT9Words(num string, words []string) (ans []string) {
s := "22233344455566677778889999"
@@ -141,6 +151,8 @@ func getValidT9Words(num string, words []string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function getValidT9Words(num: string, words: string[]): string[] {
const s = '22233344455566677778889999';
@@ -166,6 +178,8 @@ function getValidT9Words(num: string, words: string[]): string[] {
}
```
+#### Swift
+
```swift
class Solution {
func getValidT9Words(_ num: String, _ words: [String]) -> [String] {
diff --git a/lcci/16.20.T9/README_EN.md b/lcci/16.20.T9/README_EN.md
index 51dee3b912ad0..628ee5cc43918 100644
--- a/lcci/16.20.T9/README_EN.md
+++ b/lcci/16.20.T9/README_EN.md
@@ -55,6 +55,8 @@ The time complexity is $O(m \times n)$, and the space complexity is $O(C)$. Here
+#### Python3
+
```python
class Solution:
def getValidT9Words(self, num: str, words: List[str]) -> List[str]:
@@ -65,6 +67,8 @@ class Solution:
return [w for w in words if check(w)]
```
+#### Python3
+
```python
class Solution:
def getValidT9Words(self, num: str, words: List[str]) -> List[str]:
@@ -72,6 +76,8 @@ class Solution:
return [w for w in words if w.translate(trans) == num]
```
+#### Java
+
```java
class Solution {
public List getValidT9Words(String num, String[] words) {
@@ -99,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +134,8 @@ public:
};
```
+#### Go
+
```go
func getValidT9Words(num string, words []string) (ans []string) {
s := "22233344455566677778889999"
@@ -149,6 +159,8 @@ func getValidT9Words(num string, words []string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function getValidT9Words(num: string, words: string[]): string[] {
const s = '22233344455566677778889999';
@@ -174,6 +186,8 @@ function getValidT9Words(num: string, words: string[]): string[] {
}
```
+#### Swift
+
```swift
class Solution {
func getValidT9Words(_ num: String, _ words: [String]) -> [String] {
diff --git a/lcci/16.21.Sum Swap/README.md b/lcci/16.21.Sum Swap/README.md
index 996c132b90b29..69fca06983e38 100644
--- a/lcci/16.21.Sum Swap/README.md
+++ b/lcci/16.21.Sum Swap/README.md
@@ -51,6 +51,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.21.Sum%20Swap/READ
+#### Python3
+
```python
class Solution:
def findSwapValues(self, array1: List[int], array2: List[int]) -> List[int]:
@@ -65,6 +67,8 @@ class Solution:
return []
```
+#### Java
+
```java
class Solution {
public int[] findSwapValues(int[] array1, int[] array2) {
@@ -93,6 +97,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -116,6 +122,8 @@ public:
};
```
+#### Go
+
```go
func findSwapValues(array1 []int, array2 []int) []int {
s1, s2 := 0, 0
@@ -141,6 +149,8 @@ func findSwapValues(array1 []int, array2 []int) []int {
}
```
+#### TypeScript
+
```ts
function findSwapValues(array1: number[], array2: number[]): number[] {
const s1 = array1.reduce((a, b) => a + b, 0);
@@ -161,6 +171,8 @@ function findSwapValues(array1: number[], array2: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func findSwapValues(_ array1: [Int], _ array2: [Int]) -> [Int] {
diff --git a/lcci/16.21.Sum Swap/README_EN.md b/lcci/16.21.Sum Swap/README_EN.md
index b19bf3c1ec57f..a5a1dd5ef8f3c 100644
--- a/lcci/16.21.Sum Swap/README_EN.md
+++ b/lcci/16.21.Sum Swap/README_EN.md
@@ -58,6 +58,8 @@ The time complexity is $O(m + n)$, and the space complexity is $O(n)$. Here, $m$
+#### Python3
+
```python
class Solution:
def findSwapValues(self, array1: List[int], array2: List[int]) -> List[int]:
@@ -72,6 +74,8 @@ class Solution:
return []
```
+#### Java
+
```java
class Solution {
public int[] findSwapValues(int[] array1, int[] array2) {
@@ -100,6 +104,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -123,6 +129,8 @@ public:
};
```
+#### Go
+
```go
func findSwapValues(array1 []int, array2 []int) []int {
s1, s2 := 0, 0
@@ -148,6 +156,8 @@ func findSwapValues(array1 []int, array2 []int) []int {
}
```
+#### TypeScript
+
```ts
function findSwapValues(array1: number[], array2: number[]): number[] {
const s1 = array1.reduce((a, b) => a + b, 0);
@@ -168,6 +178,8 @@ function findSwapValues(array1: number[], array2: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func findSwapValues(_ array1: [Int], _ array2: [Int]) -> [Int] {
diff --git a/lcci/16.22.Langtons Ant/README.md b/lcci/16.22.Langtons Ant/README.md
index 0b357c3b8595c..62cb459c87180 100644
--- a/lcci/16.22.Langtons Ant/README.md
+++ b/lcci/16.22.Langtons Ant/README.md
@@ -63,6 +63,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.22.Langtons%20Ant/
+#### Python3
+
```python
class Solution:
def printKMoves(self, K: int) -> List[str]:
@@ -93,6 +95,8 @@ class Solution:
return ["".join(row) for row in g]
```
+#### Java
+
```java
class Solution {
public List printKMoves(int K) {
@@ -137,6 +141,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -173,6 +179,8 @@ public:
};
```
+#### Go
+
```go
func printKMoves(K int) []string {
var x1, y1, x2, y2, x, y, p int
@@ -218,6 +226,8 @@ func printKMoves(K int) []string {
}
```
+#### Swift
+
```swift
class Solution {
func printKMoves(_ K: Int) -> [String] {
diff --git a/lcci/16.22.Langtons Ant/README_EN.md b/lcci/16.22.Langtons Ant/README_EN.md
index 6a07d11045596..f1f998d73735e 100644
--- a/lcci/16.22.Langtons Ant/README_EN.md
+++ b/lcci/16.22.Langtons Ant/README_EN.md
@@ -85,6 +85,8 @@ The time complexity is $O(K)$, and the space complexity is $O(K)$. Where $K$ is
+#### Python3
+
```python
class Solution:
def printKMoves(self, K: int) -> List[str]:
@@ -115,6 +117,8 @@ class Solution:
return ["".join(row) for row in g]
```
+#### Java
+
```java
class Solution {
public List printKMoves(int K) {
@@ -159,6 +163,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -195,6 +201,8 @@ public:
};
```
+#### Go
+
```go
func printKMoves(K int) []string {
var x1, y1, x2, y2, x, y, p int
@@ -240,6 +248,8 @@ func printKMoves(K int) []string {
}
```
+#### Swift
+
```swift
class Solution {
func printKMoves(_ K: Int) -> [String] {
diff --git a/lcci/16.24.Pairs With Sum/README.md b/lcci/16.24.Pairs With Sum/README.md
index 2a25112df483c..ef77ccc0aad41 100644
--- a/lcci/16.24.Pairs With Sum/README.md
+++ b/lcci/16.24.Pairs With Sum/README.md
@@ -44,6 +44,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.24.Pairs%20With%20
+#### Python3
+
```python
class Solution:
def pairSums(self, nums: List[int], target: int) -> List[List[int]]:
@@ -59,6 +61,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List> pairSums(int[] nums, int target) {
@@ -80,6 +84,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -100,6 +106,8 @@ public:
};
```
+#### Go
+
```go
func pairSums(nums []int, target int) (ans [][]int) {
cnt := map[int]int{}
@@ -116,6 +124,8 @@ func pairSums(nums []int, target int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function pairSums(nums: number[], target: number): number[][] {
const cnt = new Map();
@@ -138,6 +148,8 @@ function pairSums(nums: number[], target: number): number[][] {
}
```
+#### Swift
+
```swift
class Solution {
func pairSums(_ nums: [Int], _ target: Int) -> [[Int]] {
diff --git a/lcci/16.24.Pairs With Sum/README_EN.md b/lcci/16.24.Pairs With Sum/README_EN.md
index 4e844281dc4b6..d66fbeb683167 100644
--- a/lcci/16.24.Pairs With Sum/README_EN.md
+++ b/lcci/16.24.Pairs With Sum/README_EN.md
@@ -50,6 +50,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def pairSums(self, nums: List[int], target: int) -> List[List[int]]:
@@ -65,6 +67,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List> pairSums(int[] nums, int target) {
@@ -86,6 +90,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -106,6 +112,8 @@ public:
};
```
+#### Go
+
```go
func pairSums(nums []int, target int) (ans [][]int) {
cnt := map[int]int{}
@@ -122,6 +130,8 @@ func pairSums(nums []int, target int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function pairSums(nums: number[], target: number): number[][] {
const cnt = new Map();
@@ -144,6 +154,8 @@ function pairSums(nums: number[], target: number): number[][] {
}
```
+#### Swift
+
```swift
class Solution {
func pairSums(_ nums: [Int], _ target: Int) -> [[Int]] {
diff --git a/lcci/16.25.LRU Cache/README.md b/lcci/16.25.LRU Cache/README.md
index 135c23da7b6ba..68f73a60b87bf 100644
--- a/lcci/16.25.LRU Cache/README.md
+++ b/lcci/16.25.LRU Cache/README.md
@@ -57,6 +57,8 @@ cache.get(4); // 返回 4
+#### Python3
+
```python
class Node:
def __init__(self, key=0, val=0):
@@ -124,6 +126,8 @@ class LRUCache:
# obj.put(key,value)
```
+#### Java
+
```java
class Node {
int key;
@@ -212,6 +216,8 @@ class LRUCache {
*/
```
+#### C++
+
```cpp
struct Node {
int k;
@@ -306,6 +312,8 @@ private:
*/
```
+#### Go
+
```go
type node struct {
key, val int
@@ -377,6 +385,8 @@ func (this *LRUCache) pushFront(n *node) {
}
```
+#### TypeScript
+
```ts
class LRUCache {
capacity: number;
@@ -413,6 +423,8 @@ class LRUCache {
*/
```
+#### Rust
+
```rust
use std::cell::RefCell;
use std::collections::HashMap;
@@ -544,6 +556,8 @@ impl LRUCache {
*/
```
+#### C#
+
```cs
public class LRUCache {
class Node {
@@ -623,6 +637,8 @@ public class LRUCache {
*/
```
+#### Swift
+
```swift
class Node {
var key: Int
diff --git a/lcci/16.25.LRU Cache/README_EN.md b/lcci/16.25.LRU Cache/README_EN.md
index 2e8d8d803e504..11e480ea76183 100644
--- a/lcci/16.25.LRU Cache/README_EN.md
+++ b/lcci/16.25.LRU Cache/README_EN.md
@@ -71,6 +71,8 @@ The time complexity is $O(1)$, and the space complexity is $O(\text{capacity})$.
+#### Python3
+
```python
class Node:
def __init__(self, key=0, val=0):
@@ -138,6 +140,8 @@ class LRUCache:
# obj.put(key,value)
```
+#### Java
+
```java
class Node {
int key;
@@ -226,6 +230,8 @@ class LRUCache {
*/
```
+#### C++
+
```cpp
struct Node {
int k;
@@ -320,6 +326,8 @@ private:
*/
```
+#### Go
+
```go
type node struct {
key, val int
@@ -391,6 +399,8 @@ func (this *LRUCache) pushFront(n *node) {
}
```
+#### TypeScript
+
```ts
class LRUCache {
capacity: number;
@@ -427,6 +437,8 @@ class LRUCache {
*/
```
+#### Rust
+
```rust
use std::cell::RefCell;
use std::collections::HashMap;
@@ -558,6 +570,8 @@ impl LRUCache {
*/
```
+#### C#
+
```cs
public class LRUCache {
class Node {
@@ -637,6 +651,8 @@ public class LRUCache {
*/
```
+#### Swift
+
```swift
class Node {
var key: Int
diff --git a/lcci/16.26.Calculator/README.md b/lcci/16.26.Calculator/README.md
index dfd063fa7896d..e022010f5d781 100644
--- a/lcci/16.26.Calculator/README.md
+++ b/lcci/16.26.Calculator/README.md
@@ -49,6 +49,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/16.26.Calculator/READ
+#### Python3
+
```python
class Solution:
def calculate(self, s: str) -> int:
@@ -74,6 +76,8 @@ class Solution:
return sum(stk)
```
+#### Java
+
```java
class Solution {
public int calculate(String s) {
@@ -106,6 +110,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -147,6 +153,8 @@ public:
};
```
+#### Go
+
```go
func calculate(s string) (ans int) {
n := len(s)
@@ -179,6 +187,8 @@ func calculate(s string) (ans int) {
}
```
+#### TypeScript
+
```ts
function calculate(s: string): number {
const n = s.length;
@@ -211,6 +221,8 @@ function calculate(s: string): number {
}
```
+#### Swift
+
```swift
class Solution {
func calculate(_ s: String) -> Int {
diff --git a/lcci/16.26.Calculator/README_EN.md b/lcci/16.26.Calculator/README_EN.md
index b5ca11f70a408..f25242db32248 100644
--- a/lcci/16.26.Calculator/README_EN.md
+++ b/lcci/16.26.Calculator/README_EN.md
@@ -61,6 +61,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Where $n$ is
+#### Python3
+
```python
class Solution:
def calculate(self, s: str) -> int:
@@ -86,6 +88,8 @@ class Solution:
return sum(stk)
```
+#### Java
+
```java
class Solution {
public int calculate(String s) {
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -159,6 +165,8 @@ public:
};
```
+#### Go
+
```go
func calculate(s string) (ans int) {
n := len(s)
@@ -191,6 +199,8 @@ func calculate(s string) (ans int) {
}
```
+#### TypeScript
+
```ts
function calculate(s: string): number {
const n = s.length;
@@ -223,6 +233,8 @@ function calculate(s: string): number {
}
```
+#### Swift
+
```swift
class Solution {
func calculate(_ s: String) -> Int {
diff --git a/lcci/17.01.Add Without Plus/README.md b/lcci/17.01.Add Without Plus/README.md
index 816e7992c1dd1..469ed43fffa66 100644
--- a/lcci/17.01.Add Without Plus/README.md
+++ b/lcci/17.01.Add Without Plus/README.md
@@ -40,6 +40,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.01.Add%20Without%2
+#### Java
+
```java
class Solution {
public int add(int a, int b) {
@@ -55,6 +57,8 @@ class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func add(_ a: Int, _ b: Int) -> Int {
diff --git a/lcci/17.01.Add Without Plus/README_EN.md b/lcci/17.01.Add Without Plus/README_EN.md
index 178e042c6e117..b15687a7891a3 100644
--- a/lcci/17.01.Add Without Plus/README_EN.md
+++ b/lcci/17.01.Add Without Plus/README_EN.md
@@ -43,6 +43,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.01.Add%20Without%2
+#### Java
+
```java
class Solution {
public int add(int a, int b) {
@@ -58,6 +60,8 @@ class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func add(_ a: Int, _ b: Int) -> Int {
diff --git a/lcci/17.04.Missing Number/README.md b/lcci/17.04.Missing Number/README.md
index a6048b1b544bc..2428ce6142b9e 100644
--- a/lcci/17.04.Missing Number/README.md
+++ b/lcci/17.04.Missing Number/README.md
@@ -47,6 +47,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.04.Missing%20Numbe
+#### Python3
+
```python
class Solution:
def missingNumber(self, nums: List[int]) -> int:
@@ -57,6 +59,8 @@ class Solution:
return len(nums)
```
+#### Java
+
```java
class Solution {
public int missingNumber(int[] nums) {
@@ -72,6 +76,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -88,6 +94,8 @@ public:
};
```
+#### Go
+
```go
func missingNumber(nums []int) int {
sort.Ints(nums)
@@ -100,6 +108,8 @@ func missingNumber(nums []int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn missing_number(mut nums: Vec) -> i32 {
@@ -115,6 +125,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -132,6 +144,8 @@ var missingNumber = function (nums) {
};
```
+#### Swift
+
```swift
class Solution {
func missingNumber(_ nums: [Int]) -> Int {
@@ -160,12 +174,16 @@ class Solution {
+#### Python3
+
```python
class Solution:
def missingNumber(self, nums: List[int]) -> int:
return sum(range(len(nums) + 1)) - sum(nums)
```
+#### Java
+
```java
class Solution {
public int missingNumber(int[] nums) {
@@ -179,6 +197,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -193,6 +213,8 @@ public:
};
```
+#### Go
+
```go
func missingNumber(nums []int) (ans int) {
ans = len(nums)
@@ -203,6 +225,8 @@ func missingNumber(nums []int) (ans int) {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn missing_number(nums: Vec) -> i32 {
@@ -222,6 +246,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -237,6 +263,8 @@ var missingNumber = function (nums) {
};
```
+#### Swift
+
```swift
class Solution {
func missingNumber(_ nums: [Int]) -> Int {
@@ -260,6 +288,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def missingNumber(self, nums: List[int]) -> int:
@@ -269,6 +299,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int missingNumber(int[] nums) {
@@ -281,6 +313,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -294,6 +328,8 @@ public:
};
```
+#### Go
+
```go
func missingNumber(nums []int) (ans int) {
for i, x := range nums {
@@ -303,6 +339,8 @@ func missingNumber(nums []int) (ans int) {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn missing_number(nums: Vec) -> i32 {
@@ -316,6 +354,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
diff --git a/lcci/17.04.Missing Number/README_EN.md b/lcci/17.04.Missing Number/README_EN.md
index 38f81c1710695..dcfba18b1ccb4 100644
--- a/lcci/17.04.Missing Number/README_EN.md
+++ b/lcci/17.04.Missing Number/README_EN.md
@@ -48,6 +48,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.04.Missing%20Numbe
+#### Python3
+
```python
class Solution:
def missingNumber(self, nums: List[int]) -> int:
@@ -58,6 +60,8 @@ class Solution:
return len(nums)
```
+#### Java
+
```java
class Solution {
public int missingNumber(int[] nums) {
@@ -73,6 +77,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -89,6 +95,8 @@ public:
};
```
+#### Go
+
```go
func missingNumber(nums []int) int {
sort.Ints(nums)
@@ -101,6 +109,8 @@ func missingNumber(nums []int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn missing_number(mut nums: Vec) -> i32 {
@@ -116,6 +126,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -133,6 +145,8 @@ var missingNumber = function (nums) {
};
```
+#### Swift
+
```swift
class Solution {
func missingNumber(_ nums: [Int]) -> Int {
@@ -157,12 +171,16 @@ class Solution {
+#### Python3
+
```python
class Solution:
def missingNumber(self, nums: List[int]) -> int:
return sum(range(len(nums) + 1)) - sum(nums)
```
+#### Java
+
```java
class Solution {
public int missingNumber(int[] nums) {
@@ -176,6 +194,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -190,6 +210,8 @@ public:
};
```
+#### Go
+
```go
func missingNumber(nums []int) (ans int) {
ans = len(nums)
@@ -200,6 +222,8 @@ func missingNumber(nums []int) (ans int) {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn missing_number(nums: Vec) -> i32 {
@@ -219,6 +243,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -234,6 +260,8 @@ var missingNumber = function (nums) {
};
```
+#### Swift
+
```swift
class Solution {
func missingNumber(_ nums: [Int]) -> Int {
@@ -253,6 +281,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def missingNumber(self, nums: List[int]) -> int:
@@ -262,6 +292,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int missingNumber(int[] nums) {
@@ -274,6 +306,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -287,6 +321,8 @@ public:
};
```
+#### Go
+
```go
func missingNumber(nums []int) (ans int) {
for i, x := range nums {
@@ -296,6 +332,8 @@ func missingNumber(nums []int) (ans int) {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn missing_number(nums: Vec) -> i32 {
@@ -309,6 +347,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
diff --git a/lcci/17.05.Find Longest Subarray/README.md b/lcci/17.05.Find Longest Subarray/README.md
index 076a25212cd65..34cd108dd4e9b 100644
--- a/lcci/17.05.Find Longest Subarray/README.md
+++ b/lcci/17.05.Find Longest Subarray/README.md
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.05.Find%20Longest%
+#### Python3
+
```python
class Solution:
def findLongestSubarray(self, array: List[str]) -> List[str]:
@@ -77,6 +79,8 @@ class Solution:
return array[k : k + mx]
```
+#### Java
+
```java
class Solution {
public String[] findLongestSubarray(String[] array) {
@@ -102,6 +106,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -125,6 +131,8 @@ public:
};
```
+#### Go
+
```go
func findLongestSubarray(array []string) []string {
vis := map[int]int{0: -1}
@@ -148,6 +156,8 @@ func findLongestSubarray(array []string) []string {
}
```
+#### TypeScript
+
```ts
function findLongestSubarray(array: string[]): string[] {
const vis = new Map();
@@ -171,6 +181,8 @@ function findLongestSubarray(array: string[]): string[] {
}
```
+#### Swift
+
```swift
class Solution {
func findLongestSubarray(_ array: [String]) -> [String] {
diff --git a/lcci/17.05.Find Longest Subarray/README_EN.md b/lcci/17.05.Find Longest Subarray/README_EN.md
index 4964a67ed6185..f5592ba586ae8 100644
--- a/lcci/17.05.Find Longest Subarray/README_EN.md
+++ b/lcci/17.05.Find Longest Subarray/README_EN.md
@@ -71,6 +71,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Where $n$ is
+#### Python3
+
```python
class Solution:
def findLongestSubarray(self, array: List[str]) -> List[str]:
@@ -87,6 +89,8 @@ class Solution:
return array[k : k + mx]
```
+#### Java
+
```java
class Solution {
public String[] findLongestSubarray(String[] array) {
@@ -112,6 +116,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -135,6 +141,8 @@ public:
};
```
+#### Go
+
```go
func findLongestSubarray(array []string) []string {
vis := map[int]int{0: -1}
@@ -158,6 +166,8 @@ func findLongestSubarray(array []string) []string {
}
```
+#### TypeScript
+
```ts
function findLongestSubarray(array: string[]): string[] {
const vis = new Map();
@@ -181,6 +191,8 @@ function findLongestSubarray(array: string[]): string[] {
}
```
+#### Swift
+
```swift
class Solution {
func findLongestSubarray(_ array: [String]) -> [String] {
diff --git a/lcci/17.06.Number Of 2s In Range/README.md b/lcci/17.06.Number Of 2s In Range/README.md
index 09b1ef0def116..1a8145049ef9f 100644
--- a/lcci/17.06.Number Of 2s In Range/README.md
+++ b/lcci/17.06.Number Of 2s In Range/README.md
@@ -65,6 +65,8 @@ $$
+#### Python3
+
```python
class Solution:
def numberOf2sInRange(self, n: int) -> int:
@@ -87,6 +89,8 @@ class Solution:
return dfs(l, 0, True)
```
+#### Java
+
```java
class Solution {
private int[] a = new int[12];
@@ -124,6 +128,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -160,6 +166,8 @@ public:
};
```
+#### Go
+
```go
func numberOf2sInRange(n int) int {
a := make([]int, 12)
@@ -205,6 +213,8 @@ func numberOf2sInRange(n int) int {
}
```
+#### Swift
+
```swift
class Solution {
private var a = [Int](repeating: 0, count: 12)
diff --git a/lcci/17.06.Number Of 2s In Range/README_EN.md b/lcci/17.06.Number Of 2s In Range/README_EN.md
index 7b2c0b40bb79f..ecafbe3f10e8d 100644
--- a/lcci/17.06.Number Of 2s In Range/README_EN.md
+++ b/lcci/17.06.Number Of 2s In Range/README_EN.md
@@ -70,6 +70,8 @@ Similar problems:
+#### Python3
+
```python
class Solution:
def numberOf2sInRange(self, n: int) -> int:
@@ -92,6 +94,8 @@ class Solution:
return dfs(l, 0, True)
```
+#### Java
+
```java
class Solution {
private int[] a = new int[12];
@@ -129,6 +133,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -165,6 +171,8 @@ public:
};
```
+#### Go
+
```go
func numberOf2sInRange(n int) int {
a := make([]int, 12)
@@ -210,6 +218,8 @@ func numberOf2sInRange(n int) int {
}
```
+#### Swift
+
```swift
class Solution {
private var a = [Int](repeating: 0, count: 12)
diff --git a/lcci/17.07.Baby Names/README.md b/lcci/17.07.Baby Names/README.md
index 8dedd1ca47940..e2ae4ace0fc86 100644
--- a/lcci/17.07.Baby Names/README.md
+++ b/lcci/17.07.Baby Names/README.md
@@ -47,6 +47,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.07.Baby%20Names/RE
+#### Python3
+
```python
class Solution:
def trulyMostPopular(self, names: List[str], synonyms: List[str]) -> List[str]:
@@ -81,6 +83,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private Map> g = new HashMap<>();
@@ -130,6 +134,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -181,6 +187,8 @@ public:
};
```
+#### Go
+
```go
func trulyMostPopular(names []string, synonyms []string) (ans []string) {
g := map[string][]string{}
@@ -227,6 +235,8 @@ func trulyMostPopular(names []string, synonyms []string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function trulyMostPopular(names: string[], synonyms: string[]): string[] {
const map = new Map();
@@ -258,6 +268,8 @@ function trulyMostPopular(names: string[], synonyms: string[]): string[] {
}
```
+#### Swift
+
```swift
class Solution {
private var graph = [String: [String]]()
diff --git a/lcci/17.07.Baby Names/README_EN.md b/lcci/17.07.Baby Names/README_EN.md
index 9b561e7d77ebb..a74f1e5fc229d 100644
--- a/lcci/17.07.Baby Names/README_EN.md
+++ b/lcci/17.07.Baby Names/README_EN.md
@@ -48,6 +48,8 @@ The time complexity is $O(n + m)$, and the space complexity is $O(n + m)$. Where
+#### Python3
+
```python
class Solution:
def trulyMostPopular(self, names: List[str], synonyms: List[str]) -> List[str]:
@@ -82,6 +84,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private Map> g = new HashMap<>();
@@ -131,6 +135,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -182,6 +188,8 @@ public:
};
```
+#### Go
+
```go
func trulyMostPopular(names []string, synonyms []string) (ans []string) {
g := map[string][]string{}
@@ -228,6 +236,8 @@ func trulyMostPopular(names []string, synonyms []string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function trulyMostPopular(names: string[], synonyms: string[]): string[] {
const map = new Map();
@@ -259,6 +269,8 @@ function trulyMostPopular(names: string[], synonyms: string[]): string[] {
}
```
+#### Swift
+
```swift
class Solution {
private var graph = [String: [String]]()
diff --git a/lcci/17.08.Circus Tower/README.md b/lcci/17.08.Circus Tower/README.md
index 960e191ab3daf..8ddcf3f528408 100644
--- a/lcci/17.08.Circus Tower/README.md
+++ b/lcci/17.08.Circus Tower/README.md
@@ -40,6 +40,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.08.Circus%20Tower/
+#### Python3
+
```python
class BinaryIndexedTree:
def __init__(self, n):
@@ -75,6 +77,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class BinaryIndexedTree {
private int n;
@@ -133,6 +137,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class BinaryIndexedTree {
public:
@@ -191,6 +197,8 @@ public:
};
```
+#### Go
+
```go
type BinaryIndexedTree struct {
n int
@@ -251,6 +259,8 @@ func bestSeqAtIndex(height []int, weight []int) int {
}
```
+#### Swift
+
```swift
class BinaryIndexedTree {
private var n: Int
diff --git a/lcci/17.08.Circus Tower/README_EN.md b/lcci/17.08.Circus Tower/README_EN.md
index 6631db764bb1c..8fd1a5b415fc2 100644
--- a/lcci/17.08.Circus Tower/README_EN.md
+++ b/lcci/17.08.Circus Tower/README_EN.md
@@ -45,6 +45,8 @@ The space complexity is $O(n)$, where $n$ is the number of people.
+#### Python3
+
```python
class BinaryIndexedTree:
def __init__(self, n):
@@ -80,6 +82,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class BinaryIndexedTree {
private int n;
@@ -138,6 +142,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class BinaryIndexedTree {
public:
@@ -196,6 +202,8 @@ public:
};
```
+#### Go
+
```go
type BinaryIndexedTree struct {
n int
@@ -256,6 +264,8 @@ func bestSeqAtIndex(height []int, weight []int) int {
}
```
+#### Swift
+
```swift
class BinaryIndexedTree {
private var n: Int
diff --git a/lcci/17.09.Get Kth Magic Number/README.md b/lcci/17.09.Get Kth Magic Number/README.md
index 056ca0eb86c5d..e371a07596055 100644
--- a/lcci/17.09.Get Kth Magic Number/README.md
+++ b/lcci/17.09.Get Kth Magic Number/README.md
@@ -36,6 +36,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.09.Get%20Kth%20Mag
+#### Python3
+
```python
class Solution:
def getKthMagicNumber(self, k: int) -> int:
@@ -50,6 +52,8 @@ class Solution:
return h[0]
```
+#### Java
+
```java
class Solution {
private static final int[] FACTORS = new int[] {3, 5, 7};
@@ -75,6 +79,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -101,6 +107,8 @@ public:
};
```
+#### Go
+
```go
func getKthMagicNumber(k int) int {
q := hp{[]int{1}}
@@ -129,6 +137,8 @@ func (h *hp) Pop() any {
}
```
+#### TypeScript
+
```ts
function getKthMagicNumber(k: number): number {
const dp = [1];
@@ -153,6 +163,8 @@ function getKthMagicNumber(k: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn get_kth_magic_number(k: i32) -> i32 {
@@ -180,6 +192,8 @@ impl Solution {
}
```
+#### C
+
```c
#define min(a, b) (((a) < (b)) ? (a) : (b))
@@ -209,6 +223,8 @@ int getKthMagicNumber(int k) {
}
```
+#### Swift
+
```swift
class Solution {
private let factors = [3, 5, 7]
@@ -255,6 +271,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def getKthMagicNumber(self, k: int) -> int:
@@ -273,6 +291,8 @@ class Solution:
return dp[k]
```
+#### Java
+
```java
class Solution {
public int getKthMagicNumber(int k) {
@@ -298,6 +318,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -323,6 +345,8 @@ public:
};
```
+#### Go
+
```go
func getKthMagicNumber(k int) int {
dp := make([]int, k+1)
diff --git a/lcci/17.09.Get Kth Magic Number/README_EN.md b/lcci/17.09.Get Kth Magic Number/README_EN.md
index b2abf23aee769..a2e451172c0f1 100644
--- a/lcci/17.09.Get Kth Magic Number/README_EN.md
+++ b/lcci/17.09.Get Kth Magic Number/README_EN.md
@@ -32,6 +32,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.09.Get%20Kth%20Mag
+#### Python3
+
```python
class Solution:
def getKthMagicNumber(self, k: int) -> int:
@@ -46,6 +48,8 @@ class Solution:
return h[0]
```
+#### Java
+
```java
class Solution {
private static final int[] FACTORS = new int[] {3, 5, 7};
@@ -71,6 +75,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -97,6 +103,8 @@ public:
};
```
+#### Go
+
```go
func getKthMagicNumber(k int) int {
q := hp{[]int{1}}
@@ -125,6 +133,8 @@ func (h *hp) Pop() any {
}
```
+#### TypeScript
+
```ts
function getKthMagicNumber(k: number): number {
const dp = [1];
@@ -149,6 +159,8 @@ function getKthMagicNumber(k: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn get_kth_magic_number(k: i32) -> i32 {
@@ -176,6 +188,8 @@ impl Solution {
}
```
+#### C
+
```c
#define min(a, b) (((a) < (b)) ? (a) : (b))
@@ -205,6 +219,8 @@ int getKthMagicNumber(int k) {
}
```
+#### Swift
+
```swift
class Solution {
private let factors = [3, 5, 7]
@@ -241,6 +257,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def getKthMagicNumber(self, k: int) -> int:
@@ -259,6 +277,8 @@ class Solution:
return dp[k]
```
+#### Java
+
```java
class Solution {
public int getKthMagicNumber(int k) {
@@ -284,6 +304,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -309,6 +331,8 @@ public:
};
```
+#### Go
+
```go
func getKthMagicNumber(k int) int {
dp := make([]int, k+1)
diff --git a/lcci/17.10.Find Majority Element/README.md b/lcci/17.10.Find Majority Element/README.md
index 2068759ac8f1e..2f135f584ff41 100644
--- a/lcci/17.10.Find Majority Element/README.md
+++ b/lcci/17.10.Find Majority Element/README.md
@@ -62,6 +62,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.10.Find%20Majority
+#### Python3
+
```python
class Solution:
def majorityElement(self, nums: List[int]) -> int:
@@ -74,6 +76,8 @@ class Solution:
return m if nums.count(m) > len(nums) // 2 else -1
```
+#### Java
+
```java
class Solution {
public int majorityElement(int[] nums) {
@@ -97,6 +101,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -115,6 +121,8 @@ public:
};
```
+#### Go
+
```go
func majorityElement(nums []int) int {
cnt, m := 0, 0
@@ -142,6 +150,8 @@ func majorityElement(nums []int) int {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -168,6 +178,8 @@ var majorityElement = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int MajorityElement(int[] nums) {
@@ -197,6 +209,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func majorityElement(_ nums: [Int]) -> Int {
diff --git a/lcci/17.10.Find Majority Element/README_EN.md b/lcci/17.10.Find Majority Element/README_EN.md
index b7edb47766472..78a4b029f2cb8 100644
--- a/lcci/17.10.Find Majority Element/README_EN.md
+++ b/lcci/17.10.Find Majority Element/README_EN.md
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.10.Find%20Majority
+#### Python3
+
```python
class Solution:
def majorityElement(self, nums: List[int]) -> int:
@@ -68,6 +70,8 @@ class Solution:
return m if nums.count(m) > len(nums) // 2 else -1
```
+#### Java
+
```java
class Solution {
public int majorityElement(int[] nums) {
@@ -91,6 +95,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -109,6 +115,8 @@ public:
};
```
+#### Go
+
```go
func majorityElement(nums []int) int {
cnt, m := 0, 0
@@ -136,6 +144,8 @@ func majorityElement(nums []int) int {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -162,6 +172,8 @@ var majorityElement = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int MajorityElement(int[] nums) {
@@ -191,6 +203,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func majorityElement(_ nums: [Int]) -> Int {
diff --git a/lcci/17.11.Find Closest/README.md b/lcci/17.11.Find Closest/README.md
index 26fe5a11b750d..a3175596b5ca2 100644
--- a/lcci/17.11.Find Closest/README.md
+++ b/lcci/17.11.Find Closest/README.md
@@ -45,6 +45,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.11.Find%20Closest/
+#### Python3
+
```python
class Solution:
def findClosest(self, words: List[str], word1: str, word2: str) -> int:
@@ -59,6 +61,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int findClosest(String[] words, String word1, String word2) {
@@ -77,6 +81,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -97,6 +103,8 @@ public:
};
```
+#### Go
+
```go
func findClosest(words []string, word1 string, word2 string) int {
const inf int = 1 << 29
@@ -113,6 +121,8 @@ func findClosest(words []string, word1 string, word2 string) int {
}
```
+#### TypeScript
+
```ts
function findClosest(words: string[], word1: string, word2: string): number {
let [i, j, ans] = [Infinity, -Infinity, Infinity];
@@ -128,6 +138,8 @@ function findClosest(words: string[], word1: string, word2: string): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn find_closest(words: Vec, word1: String, word2: String) -> i32 {
@@ -150,6 +162,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func findClosest(_ words: [String], _ word1: String, _ word2: String) -> Int {
@@ -192,6 +206,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def findClosest(self, words: List[str], word1: str, word2: str) -> int:
@@ -210,6 +226,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int findClosest(String[] words, String word1, String word2) {
@@ -234,6 +252,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -259,6 +279,8 @@ public:
};
```
+#### Go
+
```go
func findClosest(words []string, word1 string, word2 string) int {
d := map[string][]int{}
@@ -283,6 +305,8 @@ func findClosest(words []string, word1 string, word2 string) int {
}
```
+#### TypeScript
+
```ts
function findClosest(words: string[], word1: string, word2: string): number {
const d: Map = new Map();
diff --git a/lcci/17.11.Find Closest/README_EN.md b/lcci/17.11.Find Closest/README_EN.md
index 93bb431c2b3ee..740311454901a 100644
--- a/lcci/17.11.Find Closest/README_EN.md
+++ b/lcci/17.11.Find Closest/README_EN.md
@@ -48,6 +48,8 @@ The time complexity is $O(n)$, where $n$ is the number of words in the text file
+#### Python3
+
```python
class Solution:
def findClosest(self, words: List[str], word1: str, word2: str) -> int:
@@ -62,6 +64,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int findClosest(String[] words, String word1, String word2) {
@@ -80,6 +84,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -100,6 +106,8 @@ public:
};
```
+#### Go
+
```go
func findClosest(words []string, word1 string, word2 string) int {
const inf int = 1 << 29
@@ -116,6 +124,8 @@ func findClosest(words []string, word1 string, word2 string) int {
}
```
+#### TypeScript
+
```ts
function findClosest(words: string[], word1: string, word2: string): number {
let [i, j, ans] = [Infinity, -Infinity, Infinity];
@@ -131,6 +141,8 @@ function findClosest(words: string[], word1: string, word2: string): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn find_closest(words: Vec, word1: String, word2: String) -> i32 {
@@ -153,6 +165,8 @@ impl Solution {
}
```
+#### Swift
+
```swift
class Solution {
func findClosest(_ words: [String], _ word1: String, _ word2: String) -> Int {
@@ -195,6 +209,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Where $n$ is
+#### Python3
+
```python
class Solution:
def findClosest(self, words: List[str], word1: str, word2: str) -> int:
@@ -213,6 +229,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int findClosest(String[] words, String word1, String word2) {
@@ -237,6 +255,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -262,6 +282,8 @@ public:
};
```
+#### Go
+
```go
func findClosest(words []string, word1 string, word2 string) int {
d := map[string][]int{}
@@ -286,6 +308,8 @@ func findClosest(words []string, word1 string, word2 string) int {
}
```
+#### TypeScript
+
```ts
function findClosest(words: string[], word1: string, word2: string): number {
const d: Map = new Map();
diff --git a/lcci/17.12.BiNode/README.md b/lcci/17.12.BiNode/README.md
index 937d8fae18580..5de418f544c70 100644
--- a/lcci/17.12.BiNode/README.md
+++ b/lcci/17.12.BiNode/README.md
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.12.BiNode/README.m
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -77,6 +79,8 @@ class Solution:
return dummy.right
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -110,6 +114,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -142,6 +148,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -170,6 +178,8 @@ func convertBiNode(root *TreeNode) *TreeNode {
}
```
+#### JavaScript
+
```js
const convertBiNode = root => {
const dfs = root => {
diff --git a/lcci/17.12.BiNode/README_EN.md b/lcci/17.12.BiNode/README_EN.md
index c7fa5da0fcb16..44db3ef177d33 100644
--- a/lcci/17.12.BiNode/README_EN.md
+++ b/lcci/17.12.BiNode/README_EN.md
@@ -48,6 +48,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.12.BiNode/README_E
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -75,6 +77,8 @@ class Solution:
return dummy.right
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -108,6 +112,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -140,6 +146,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -168,6 +176,8 @@ func convertBiNode(root *TreeNode) *TreeNode {
}
```
+#### JavaScript
+
```js
const convertBiNode = root => {
const dfs = root => {
diff --git a/lcci/17.13.Re-Space/README.md b/lcci/17.13.Re-Space/README.md
index 2ce510955b7ce..4e74315168efa 100644
--- a/lcci/17.13.Re-Space/README.md
+++ b/lcci/17.13.Re-Space/README.md
@@ -47,6 +47,8 @@ sentence = "jesslookedjustliketimherbrother"
+#### Python3
+
```python
class Solution:
def respace(self, dictionary: List[str], sentence: str) -> int:
@@ -61,6 +63,8 @@ class Solution:
return dp[-1]
```
+#### Java
+
```java
class Solution {
public int respace(String[] dictionary, String sentence) {
@@ -80,6 +84,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -100,6 +106,8 @@ public:
};
```
+#### Go
+
```go
func respace(dictionary []string, sentence string) int {
s := map[string]bool{}
@@ -120,6 +128,8 @@ func respace(dictionary []string, sentence string) int {
}
```
+#### Swift
+
```swift
class TrieNode {
var children: [TrieNode?] = Array(repeating: nil, count: 26)
diff --git a/lcci/17.13.Re-Space/README_EN.md b/lcci/17.13.Re-Space/README_EN.md
index 4d83a5dd9c5fb..75f3ca3c62f26 100644
--- a/lcci/17.13.Re-Space/README_EN.md
+++ b/lcci/17.13.Re-Space/README_EN.md
@@ -54,6 +54,8 @@ sentence = "jesslookedjustliketimherbrother"
+#### Python3
+
```python
class Solution:
def respace(self, dictionary: List[str], sentence: str) -> int:
@@ -68,6 +70,8 @@ class Solution:
return dp[-1]
```
+#### Java
+
```java
class Solution {
public int respace(String[] dictionary, String sentence) {
@@ -87,6 +91,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -107,6 +113,8 @@ public:
};
```
+#### Go
+
```go
func respace(dictionary []string, sentence string) int {
s := map[string]bool{}
@@ -127,6 +135,8 @@ func respace(dictionary []string, sentence string) int {
}
```
+#### Swift
+
```swift
class TrieNode {
var children: [TrieNode?] = Array(repeating: nil, count: 26)
diff --git a/lcci/17.14.Smallest K/README.md b/lcci/17.14.Smallest K/README.md
index ec2df13e71788..2c402107c0c43 100644
--- a/lcci/17.14.Smallest K/README.md
+++ b/lcci/17.14.Smallest K/README.md
@@ -39,12 +39,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.14.Smallest%20K/RE
+#### Python3
+
```python
class Solution:
def smallestK(self, arr: List[int], k: int) -> List[int]:
return sorted(arr)[:k]
```
+#### Java
+
```java
class Solution {
public int[] smallestK(int[] arr, int k) {
@@ -58,6 +62,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -72,6 +78,8 @@ public:
};
```
+#### Go
+
```go
func smallestK(arr []int, k int) []int {
sort.Ints(arr)
@@ -83,6 +91,8 @@ func smallestK(arr []int, k int) []int {
}
```
+#### Swift
+
```swift
class Solution {
func smallestK(_ arr: [Int], _ k: Int) -> [Int] {
@@ -109,6 +119,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def smallestK(self, arr: List[int], k: int) -> List[int]:
@@ -120,6 +132,8 @@ class Solution:
return [-v for v in h]
```
+#### Java
+
```java
class Solution {
public int[] smallestK(int[] arr, int k) {
@@ -140,6 +154,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -161,6 +177,8 @@ public:
};
```
+#### Go
+
```go
func smallestK(arr []int, k int) []int {
q := hp{}
diff --git a/lcci/17.14.Smallest K/README_EN.md b/lcci/17.14.Smallest K/README_EN.md
index 7fb1da91169cb..c34daf8e12ab1 100644
--- a/lcci/17.14.Smallest K/README_EN.md
+++ b/lcci/17.14.Smallest K/README_EN.md
@@ -39,12 +39,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.14.Smallest%20K/RE
+#### Python3
+
```python
class Solution:
def smallestK(self, arr: List[int], k: int) -> List[int]:
return sorted(arr)[:k]
```
+#### Java
+
```java
class Solution {
public int[] smallestK(int[] arr, int k) {
@@ -58,6 +62,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -72,6 +78,8 @@ public:
};
```
+#### Go
+
```go
func smallestK(arr []int, k int) []int {
sort.Ints(arr)
@@ -83,6 +91,8 @@ func smallestK(arr []int, k int) []int {
}
```
+#### Swift
+
```swift
class Solution {
func smallestK(_ arr: [Int], _ k: Int) -> [Int] {
@@ -103,6 +113,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def smallestK(self, arr: List[int], k: int) -> List[int]:
@@ -114,6 +126,8 @@ class Solution:
return [-v for v in h]
```
+#### Java
+
```java
class Solution {
public int[] smallestK(int[] arr, int k) {
@@ -134,6 +148,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -155,6 +171,8 @@ public:
};
```
+#### Go
+
```go
func smallestK(arr []int, k int) []int {
q := hp{}
diff --git a/lcci/17.15.Longest Word/README.md b/lcci/17.15.Longest Word/README.md
index d1123e0736604..a9840705c9c6a 100644
--- a/lcci/17.15.Longest Word/README.md
+++ b/lcci/17.15.Longest Word/README.md
@@ -36,6 +36,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.15.Longest%20Word/
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -83,6 +85,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Trie {
Trie[] children = new Trie[26];
@@ -147,6 +151,8 @@ class Solution {
}
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
@@ -212,6 +218,8 @@ func longestWord(words []string) string {
}
```
+#### Swift
+
```swift
class Trie {
var children = [Trie?](repeating: nil, count: 26)
diff --git a/lcci/17.15.Longest Word/README_EN.md b/lcci/17.15.Longest Word/README_EN.md
index fa339920b2f71..7d5dcf7f14dec 100644
--- a/lcci/17.15.Longest Word/README_EN.md
+++ b/lcci/17.15.Longest Word/README_EN.md
@@ -45,6 +45,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.15.Longest%20Word/
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -92,6 +94,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Trie {
Trie[] children = new Trie[26];
@@ -156,6 +160,8 @@ class Solution {
}
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
@@ -221,6 +227,8 @@ func longestWord(words []string) string {
}
```
+#### Swift
+
```swift
class Trie {
var children = [Trie?](repeating: nil, count: 26)
diff --git a/lcci/17.16.The Masseuse/README.md b/lcci/17.16.The Masseuse/README.md
index da59857ee2eeb..77381b986b5f1 100644
--- a/lcci/17.16.The Masseuse/README.md
+++ b/lcci/17.16.The Masseuse/README.md
@@ -68,6 +68,8 @@ $$
+#### Python3
+
```python
class Solution:
def massage(self, nums: List[int]) -> int:
@@ -77,6 +79,8 @@ class Solution:
return max(f, g)
```
+#### Java
+
```java
class Solution {
public int massage(int[] nums) {
@@ -92,6 +96,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -108,6 +114,8 @@ public:
};
```
+#### Go
+
```go
func massage(nums []int) int {
f, g := 0, 0
@@ -118,6 +126,8 @@ func massage(nums []int) int {
}
```
+#### TypeScript
+
```ts
function massage(nums: number[]): number {
let f = 0,
@@ -132,6 +142,8 @@ function massage(nums: number[]): number {
}
```
+#### Swift
+
```swift
class Solution {
func massage(_ nums: [Int]) -> Int {
diff --git a/lcci/17.16.The Masseuse/README_EN.md b/lcci/17.16.The Masseuse/README_EN.md
index 7d610aab3e408..3cd144a22a3a8 100644
--- a/lcci/17.16.The Masseuse/README_EN.md
+++ b/lcci/17.16.The Masseuse/README_EN.md
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.16.The%20Masseuse/
+#### Python3
+
```python
class Solution:
def massage(self, nums: List[int]) -> int:
@@ -75,6 +77,8 @@ class Solution:
return max(f, g)
```
+#### Java
+
```java
class Solution {
public int massage(int[] nums) {
@@ -90,6 +94,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -106,6 +112,8 @@ public:
};
```
+#### Go
+
```go
func massage(nums []int) int {
f, g := 0, 0
@@ -116,6 +124,8 @@ func massage(nums []int) int {
}
```
+#### TypeScript
+
```ts
function massage(nums: number[]): number {
let f = 0,
@@ -130,6 +140,8 @@ function massage(nums: number[]): number {
}
```
+#### Swift
+
```swift
class Solution {
func massage(_ nums: [Int]) -> Int {
diff --git a/lcci/17.17.Multi Search/README.md b/lcci/17.17.Multi Search/README.md
index f102467480e66..55074dc86014c 100644
--- a/lcci/17.17.Multi Search/README.md
+++ b/lcci/17.17.Multi Search/README.md
@@ -44,6 +44,8 @@ smalls = ["is","ppi","hi","sis","i&
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -86,6 +88,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[][] multiSearch(String big, String[] smalls) {
@@ -152,6 +156,8 @@ class Trie {
}
```
+#### C++
+
```cpp
class Trie {
private:
@@ -203,6 +209,8 @@ public:
};
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
@@ -259,6 +267,8 @@ func multiSearch(big string, smalls []string) [][]int {
}
```
+#### Swift
+
```swift
class TrieNode {
var idx: Int
diff --git a/lcci/17.17.Multi Search/README_EN.md b/lcci/17.17.Multi Search/README_EN.md
index 16b4657050d04..66fb57196e0a8 100644
--- a/lcci/17.17.Multi Search/README_EN.md
+++ b/lcci/17.17.Multi Search/README_EN.md
@@ -50,6 +50,8 @@ smalls = ["is","ppi","hi","sis","i&
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -92,6 +94,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[][] multiSearch(String big, String[] smalls) {
@@ -158,6 +162,8 @@ class Trie {
}
```
+#### C++
+
```cpp
class Trie {
private:
@@ -209,6 +215,8 @@ public:
};
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
@@ -265,6 +273,8 @@ func multiSearch(big string, smalls []string) [][]int {
}
```
+#### Swift
+
```swift
class TrieNode {
var idx: Int
diff --git a/lcci/17.18.Shortest Supersequence/README.md b/lcci/17.18.Shortest Supersequence/README.md
index 4414966df71db..49364c92666d3 100644
--- a/lcci/17.18.Shortest Supersequence/README.md
+++ b/lcci/17.18.Shortest Supersequence/README.md
@@ -48,6 +48,8 @@ small = [4]
+#### Python3
+
```python
class Solution:
def shortestSeq(self, big: List[int], small: List[int]) -> List[int]:
@@ -69,6 +71,8 @@ class Solution:
return [] if k < 0 else [k, k + mi - 1]
```
+#### Java
+
```java
class Solution {
public int[] shortestSeq(int[] big, int[] small) {
@@ -100,6 +104,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -135,6 +141,8 @@ public:
};
```
+#### Go
+
```go
func shortestSeq(big []int, small []int) []int {
cnt := len(small)
@@ -168,6 +176,8 @@ func shortestSeq(big []int, small []int) []int {
}
```
+#### TypeScript
+
```ts
function shortestSeq(big: number[], small: number[]): number[] {
let cnt = small.length;
@@ -199,6 +209,8 @@ function shortestSeq(big: number[], small: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func shortestSeq(_ big: [Int], _ small: [Int]) -> [Int] {
diff --git a/lcci/17.18.Shortest Supersequence/README_EN.md b/lcci/17.18.Shortest Supersequence/README_EN.md
index c71e2d7086a07..d4227da6318b2 100644
--- a/lcci/17.18.Shortest Supersequence/README_EN.md
+++ b/lcci/17.18.Shortest Supersequence/README_EN.md
@@ -54,6 +54,8 @@ small = [4]
+#### Python3
+
```python
class Solution:
def shortestSeq(self, big: List[int], small: List[int]) -> List[int]:
@@ -75,6 +77,8 @@ class Solution:
return [] if k < 0 else [k, k + mi - 1]
```
+#### Java
+
```java
class Solution {
public int[] shortestSeq(int[] big, int[] small) {
@@ -106,6 +110,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -141,6 +147,8 @@ public:
};
```
+#### Go
+
```go
func shortestSeq(big []int, small []int) []int {
cnt := len(small)
@@ -174,6 +182,8 @@ func shortestSeq(big []int, small []int) []int {
}
```
+#### TypeScript
+
```ts
function shortestSeq(big: number[], small: number[]): number[] {
let cnt = small.length;
@@ -205,6 +215,8 @@ function shortestSeq(big: number[], small: number[]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func shortestSeq(_ big: [Int], _ small: [Int]) -> [Int] {
diff --git a/lcci/17.19.Missing Two/README.md b/lcci/17.19.Missing Two/README.md
index c8b3e66ca8fb0..2f1362302e780 100644
--- a/lcci/17.19.Missing Two/README.md
+++ b/lcci/17.19.Missing Two/README.md
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.19.Missing%20Two/R
+#### Python3
+
```python
class Solution:
def missingTwo(self, nums: List[int]) -> List[int]:
@@ -78,6 +80,8 @@ class Solution:
return [a, b]
```
+#### Java
+
```java
class Solution {
public int[] missingTwo(int[] nums) {
@@ -107,6 +111,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -128,6 +134,8 @@ public:
};
```
+#### Go
+
```go
func missingTwo(nums []int) []int {
n := len(nums) + 2
@@ -155,6 +163,8 @@ func missingTwo(nums []int) []int {
}
```
+#### Swift
+
```swift
class Solution {
func missingTwo(_ nums: [Int]) -> [Int] {
diff --git a/lcci/17.19.Missing Two/README_EN.md b/lcci/17.19.Missing Two/README_EN.md
index 33650bf0f6cf2..f109366a6a356 100644
--- a/lcci/17.19.Missing Two/README_EN.md
+++ b/lcci/17.19.Missing Two/README_EN.md
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.19.Missing%20Two/R
+#### Python3
+
```python
class Solution:
def missingTwo(self, nums: List[int]) -> List[int]:
@@ -72,6 +74,8 @@ class Solution:
return [a, b]
```
+#### Java
+
```java
class Solution {
public int[] missingTwo(int[] nums) {
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -122,6 +128,8 @@ public:
};
```
+#### Go
+
```go
func missingTwo(nums []int) []int {
n := len(nums) + 2
@@ -149,6 +157,8 @@ func missingTwo(nums []int) []int {
}
```
+#### Swift
+
```swift
class Solution {
func missingTwo(_ nums: [Int]) -> [Int] {
diff --git a/lcci/17.20.Continuous Median/README.md b/lcci/17.20.Continuous Median/README.md
index baf454a1728a7..b3074347e30ca 100644
--- a/lcci/17.20.Continuous Median/README.md
+++ b/lcci/17.20.Continuous Median/README.md
@@ -60,6 +60,8 @@ findMedian() -> 2
+#### Python3
+
```python
class MedianFinder:
def __init__(self):
@@ -87,6 +89,8 @@ class MedianFinder:
# param_2 = obj.findMedian()
```
+#### Java
+
```java
class MedianFinder {
private PriorityQueue q1 = new PriorityQueue<>();
@@ -120,6 +124,8 @@ class MedianFinder {
*/
```
+#### C++
+
```cpp
class MedianFinder {
public:
@@ -157,6 +163,8 @@ private:
*/
```
+#### Go
+
```go
type MedianFinder struct {
q1 hp
@@ -202,6 +210,8 @@ func (h *hp) Pop() any {
}
```
+#### Swift
+
```swift
class MedianFinder {
private var minHeap = Heap(sort: <)
diff --git a/lcci/17.20.Continuous Median/README_EN.md b/lcci/17.20.Continuous Median/README_EN.md
index b355748a76f49..9fa0d7acfba2a 100644
--- a/lcci/17.20.Continuous Median/README_EN.md
+++ b/lcci/17.20.Continuous Median/README_EN.md
@@ -57,6 +57,8 @@ findMedian() -> 2
+#### Python3
+
```python
class MedianFinder:
def __init__(self):
@@ -84,6 +86,8 @@ class MedianFinder:
# param_2 = obj.findMedian()
```
+#### Java
+
```java
class MedianFinder {
private PriorityQueue q1 = new PriorityQueue<>();
@@ -117,6 +121,8 @@ class MedianFinder {
*/
```
+#### C++
+
```cpp
class MedianFinder {
public:
@@ -154,6 +160,8 @@ private:
*/
```
+#### Go
+
```go
type MedianFinder struct {
q1 hp
@@ -199,6 +207,8 @@ func (h *hp) Pop() any {
}
```
+#### Swift
+
```swift
class MedianFinder {
private var minHeap = Heap(sort: <)
diff --git a/lcci/17.21.Volume of Histogram/README.md b/lcci/17.21.Volume of Histogram/README.md
index 4e89ab76bdec8..4b5c85827fcca 100644
--- a/lcci/17.21.Volume of Histogram/README.md
+++ b/lcci/17.21.Volume of Histogram/README.md
@@ -43,6 +43,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.21.Volume%20of%20H
+#### Python3
+
```python
class Solution:
def trap(self, height: List[int]) -> int:
@@ -57,6 +59,8 @@ class Solution:
return sum(min(l, r) - h for l, r, h in zip(left, right, height))
```
+#### Java
+
```java
class Solution {
public int trap(int[] height) {
@@ -81,6 +85,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -105,6 +111,8 @@ public:
};
```
+#### Go
+
```go
func trap(height []int) (ans int) {
n := len(height)
@@ -125,6 +133,8 @@ func trap(height []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function trap(height: number[]): number {
const n = height.length;
@@ -145,6 +155,8 @@ function trap(height: number[]): number {
}
```
+#### C#
+
```cs
public class Solution {
public int Trap(int[] height) {
@@ -169,6 +181,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func trap(_ height: [Int]) -> Int {
diff --git a/lcci/17.21.Volume of Histogram/README_EN.md b/lcci/17.21.Volume of Histogram/README_EN.md
index 26cc4e879f911..44b2af3f2c812 100644
--- a/lcci/17.21.Volume of Histogram/README_EN.md
+++ b/lcci/17.21.Volume of Histogram/README_EN.md
@@ -38,6 +38,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.21.Volume%20of%20H
+#### Python3
+
```python
class Solution:
def trap(self, height: List[int]) -> int:
@@ -52,6 +54,8 @@ class Solution:
return sum(min(l, r) - h for l, r, h in zip(left, right, height))
```
+#### Java
+
```java
class Solution {
public int trap(int[] height) {
@@ -76,6 +80,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -100,6 +106,8 @@ public:
};
```
+#### Go
+
```go
func trap(height []int) (ans int) {
n := len(height)
@@ -120,6 +128,8 @@ func trap(height []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function trap(height: number[]): number {
const n = height.length;
@@ -140,6 +150,8 @@ function trap(height: number[]): number {
}
```
+#### C#
+
```cs
public class Solution {
public int Trap(int[] height) {
@@ -164,6 +176,8 @@ public class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func trap(_ height: [Int]) -> Int {
diff --git a/lcci/17.22.Word Transformer/README.md b/lcci/17.22.Word Transformer/README.md
index 1ecee62c17601..3955d805a6aed 100644
--- a/lcci/17.22.Word Transformer/README.md
+++ b/lcci/17.22.Word Transformer/README.md
@@ -62,6 +62,8 @@ wordList = ["hot","dot","dog","lot",&quo
+#### Python3
+
```python
class Solution:
def findLadders(
@@ -87,6 +89,8 @@ class Solution:
return ans if dfs(beginWord) else []
```
+#### Java
+
```java
class Solution {
private List ans = new ArrayList<>();
@@ -136,6 +140,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -187,6 +193,8 @@ private:
};
```
+#### Go
+
```go
func findLadders(beginWord string, endWord string, wordList []string) []string {
ans := []string{beginWord}
@@ -227,6 +235,8 @@ func findLadders(beginWord string, endWord string, wordList []string) []string {
}
```
+#### TypeScript
+
```ts
function findLadders(beginWord: string, endWord: string, wordList: string[]): string[] {
const ans: string[] = [beginWord];
@@ -264,6 +274,8 @@ function findLadders(beginWord: string, endWord: string, wordList: string[]): st
}
```
+#### Swift
+
```swift
class Solution {
private var ans: [String] = []
diff --git a/lcci/17.22.Word Transformer/README_EN.md b/lcci/17.22.Word Transformer/README_EN.md
index 0e784e552c83d..78c1ecfa99be6 100644
--- a/lcci/17.22.Word Transformer/README_EN.md
+++ b/lcci/17.22.Word Transformer/README_EN.md
@@ -80,6 +80,8 @@ Finally, we call `dfs(beginWord)`. If `True` is returned, the conversion is succ
+#### Python3
+
```python
class Solution:
def findLadders(
@@ -105,6 +107,8 @@ class Solution:
return ans if dfs(beginWord) else []
```
+#### Java
+
```java
class Solution {
private List ans = new ArrayList<>();
@@ -154,6 +158,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -205,6 +211,8 @@ private:
};
```
+#### Go
+
```go
func findLadders(beginWord string, endWord string, wordList []string) []string {
ans := []string{beginWord}
@@ -245,6 +253,8 @@ func findLadders(beginWord string, endWord string, wordList []string) []string {
}
```
+#### TypeScript
+
```ts
function findLadders(beginWord: string, endWord: string, wordList: string[]): string[] {
const ans: string[] = [beginWord];
@@ -282,6 +292,8 @@ function findLadders(beginWord: string, endWord: string, wordList: string[]): st
}
```
+#### Swift
+
```swift
class Solution {
private var ans: [String] = []
diff --git a/lcci/17.23.Max Black Square/README.md b/lcci/17.23.Max Black Square/README.md
index 9d693211b640a..a109449e1845d 100644
--- a/lcci/17.23.Max Black Square/README.md
+++ b/lcci/17.23.Max Black Square/README.md
@@ -82,6 +82,8 @@ $$
+#### Python3
+
```python
class Solution:
def findSquare(self, matrix: List[List[int]]) -> List[int]:
@@ -106,6 +108,8 @@ class Solution:
return []
```
+#### Java
+
```java
class Solution {
public int[] findSquare(int[][] matrix) {
@@ -135,6 +139,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -166,6 +172,8 @@ public:
};
```
+#### Go
+
```go
func findSquare(matrix [][]int) []int {
n := len(matrix)
@@ -201,6 +209,8 @@ func findSquare(matrix [][]int) []int {
}
```
+#### TypeScript
+
```ts
function findSquare(matrix: number[][]): number[] {
const n = matrix.length;
@@ -232,6 +242,8 @@ function findSquare(matrix: number[][]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func findSquare(_ matrix: [[Int]]) -> [Int] {
diff --git a/lcci/17.23.Max Black Square/README_EN.md b/lcci/17.23.Max Black Square/README_EN.md
index 6148644f1ebd5..48576e74b7c08 100644
--- a/lcci/17.23.Max Black Square/README_EN.md
+++ b/lcci/17.23.Max Black Square/README_EN.md
@@ -69,6 +69,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.23.Max%20Black%20S
+#### Python3
+
```python
class Solution:
def findSquare(self, matrix: List[List[int]]) -> List[int]:
@@ -93,6 +95,8 @@ class Solution:
return []
```
+#### Java
+
```java
class Solution {
public int[] findSquare(int[][] matrix) {
@@ -122,6 +126,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -153,6 +159,8 @@ public:
};
```
+#### Go
+
```go
func findSquare(matrix [][]int) []int {
n := len(matrix)
@@ -188,6 +196,8 @@ func findSquare(matrix [][]int) []int {
}
```
+#### TypeScript
+
```ts
function findSquare(matrix: number[][]): number[] {
const n = matrix.length;
@@ -219,6 +229,8 @@ function findSquare(matrix: number[][]): number[] {
}
```
+#### Swift
+
```swift
class Solution {
func findSquare(_ matrix: [[Int]]) -> [Int] {
diff --git a/lcci/17.24.Max Submatrix/README.md b/lcci/17.24.Max Submatrix/README.md
index d9546f9ba637e..403b9d8950f4e 100644
--- a/lcci/17.24.Max Submatrix/README.md
+++ b/lcci/17.24.Max Submatrix/README.md
@@ -46,6 +46,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.24.Max%20Submatrix
+#### Python3
+
```python
class Solution:
def getMaxMatrix(self, matrix: List[List[int]]) -> List[int]:
@@ -78,6 +80,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] getMaxMatrix(int[][] matrix) {
@@ -117,6 +121,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -157,6 +163,8 @@ public:
};
```
+#### Go
+
```go
func getMaxMatrix(matrix [][]int) []int {
m, n := len(matrix), len(matrix[0])
@@ -197,6 +205,8 @@ func getMaxMatrix(matrix [][]int) []int {
}
```
+#### Swift
+
```swift
class Solution {
func getMaxMatrix(_ matrix: [[Int]]) -> [Int] {
diff --git a/lcci/17.24.Max Submatrix/README_EN.md b/lcci/17.24.Max Submatrix/README_EN.md
index 4f8dcec810d86..b869d41fd51cf 100644
--- a/lcci/17.24.Max Submatrix/README_EN.md
+++ b/lcci/17.24.Max Submatrix/README_EN.md
@@ -52,6 +52,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.24.Max%20Submatrix
+#### Python3
+
```python
class Solution:
def getMaxMatrix(self, matrix: List[List[int]]) -> List[int]:
@@ -84,6 +86,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] getMaxMatrix(int[][] matrix) {
@@ -123,6 +127,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -163,6 +169,8 @@ public:
};
```
+#### Go
+
```go
func getMaxMatrix(matrix [][]int) []int {
m, n := len(matrix), len(matrix[0])
@@ -203,6 +211,8 @@ func getMaxMatrix(matrix [][]int) []int {
}
```
+#### Swift
+
```swift
class Solution {
func getMaxMatrix(_ matrix: [[Int]]) -> [Int] {
diff --git a/lcci/17.25.Word Rectangle/README.md b/lcci/17.25.Word Rectangle/README.md
index df2b4e5f65d3a..5669b8df47131 100644
--- a/lcci/17.25.Word Rectangle/README.md
+++ b/lcci/17.25.Word Rectangle/README.md
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.25.Word%20Rectangl
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -115,6 +117,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Trie {
Trie[] children = new Trie[26];
@@ -195,6 +199,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Trie {
public:
@@ -279,6 +285,8 @@ public:
};
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
@@ -355,6 +363,8 @@ func maxRectangle(words []string) (ans []string) {
}
```
+#### Swift
+
```swift
class Trie {
var children = [Trie?](repeating: nil, count: 26)
diff --git a/lcci/17.25.Word Rectangle/README_EN.md b/lcci/17.25.Word Rectangle/README_EN.md
index 1f26d5dd27b6a..2fb90d5edb957 100644
--- a/lcci/17.25.Word Rectangle/README_EN.md
+++ b/lcci/17.25.Word Rectangle/README_EN.md
@@ -57,6 +57,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.25.Word%20Rectangl
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -122,6 +124,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Trie {
Trie[] children = new Trie[26];
@@ -202,6 +206,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Trie {
public:
@@ -286,6 +292,8 @@ public:
};
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
@@ -362,6 +370,8 @@ func maxRectangle(words []string) (ans []string) {
}
```
+#### Swift
+
```swift
class Trie {
var children = [Trie?](repeating: nil, count: 26)
diff --git a/lcci/17.26.Sparse Similarity/README.md b/lcci/17.26.Sparse Similarity/README.md
index efb91e7e1f936..9c7984a2fa4b7 100644
--- a/lcci/17.26.Sparse Similarity/README.md
+++ b/lcci/17.26.Sparse Similarity/README.md
@@ -53,6 +53,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.26.Sparse%20Simila
+#### Python3
+
```python
class Solution:
def computeSimilarities(self, docs: List[List[int]]) -> List[str]:
@@ -75,6 +77,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List computeSimilarities(int[][] docs) {
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
using pii = pair;
@@ -145,6 +151,8 @@ public:
};
```
+#### Go
+
```go
func computeSimilarities(docs [][]int) []string {
d := map[int][]int{}
diff --git a/lcci/17.26.Sparse Similarity/README_EN.md b/lcci/17.26.Sparse Similarity/README_EN.md
index dc3a78a393c5a..0361ace0f2672 100644
--- a/lcci/17.26.Sparse Similarity/README_EN.md
+++ b/lcci/17.26.Sparse Similarity/README_EN.md
@@ -62,6 +62,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcci/17.26.Sparse%20Simila
+#### Python3
+
```python
class Solution:
def computeSimilarities(self, docs: List[List[int]]) -> List[str]:
@@ -84,6 +86,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List computeSimilarities(int[][] docs) {
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
using pii = pair;
@@ -154,6 +160,8 @@ public:
};
```
+#### Go
+
```go
func computeSimilarities(docs [][]int) []string {
d := map[int][]int{}
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23003. \346\225\260\347\273\204\344\270\255\351\207\215\345\244\215\347\232\204\346\225\260\345\255\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23003. \346\225\260\347\273\204\344\270\255\351\207\215\345\244\215\347\232\204\346\225\260\345\255\227/README.md"
index 3062b92beec61..c48b91b76c102 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23003. \346\225\260\347\273\204\344\270\255\351\207\215\345\244\215\347\232\204\346\225\260\345\255\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23003. \346\225\260\347\273\204\344\270\255\351\207\215\345\244\215\347\232\204\346\225\260\345\255\227/README.md"
@@ -44,6 +44,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def findRepeatNumber(self, nums: List[int]) -> int:
@@ -52,6 +54,8 @@ class Solution:
return a
```
+#### Java
+
```java
class Solution {
public int findRepeatNumber(int[] nums) {
@@ -65,6 +69,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -79,6 +85,8 @@ public:
};
```
+#### Go
+
```go
func findRepeatNumber(nums []int) int {
sort.Ints(nums)
@@ -90,6 +98,8 @@ func findRepeatNumber(nums []int) int {
}
```
+#### TypeScript
+
```ts
function findRepeatNumber(nums: number[]): number {
for (let i = 0; ; ++i) {
@@ -104,6 +114,8 @@ function findRepeatNumber(nums: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn find_repeat_number(mut nums: Vec) -> i32 {
@@ -121,6 +133,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -139,6 +153,8 @@ var findRepeatNumber = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int FindRepeatNumber(int[] nums) {
@@ -157,6 +173,8 @@ public class Solution {
}
```
+#### Kotlin
+
```kotlin
class Solution {
fun findRepeatNumber(nums: IntArray): Int {
@@ -193,6 +211,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def findRepeatNumber(self, nums: List[int]) -> int:
@@ -203,6 +223,8 @@ class Solution:
vis.add(v)
```
+#### Java
+
```java
class Solution {
public int findRepeatNumber(int[] nums) {
@@ -216,6 +238,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -231,6 +255,8 @@ public:
};
```
+#### Go
+
```go
func findRepeatNumber(nums []int) int {
vis := map[int]bool{}
@@ -257,6 +283,8 @@ func findRepeatNumber(nums []int) int {
+#### Python3
+
```python
class Solution:
def findRepeatNumber(self, nums: List[int]) -> int:
@@ -268,6 +296,8 @@ class Solution:
v = nums[i]
```
+#### Java
+
```java
class Solution {
public int findRepeatNumber(int[] nums) {
@@ -286,6 +316,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -303,6 +335,8 @@ public:
};
```
+#### Go
+
```go
func findRepeatNumber(nums []int) int {
for i := 0; ; i++ {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23004. \344\272\214\347\273\264\346\225\260\347\273\204\344\270\255\347\232\204\346\237\245\346\211\276/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23004. \344\272\214\347\273\264\346\225\260\347\273\204\344\270\255\347\232\204\346\237\245\346\211\276/README.md"
index 86198af6c5cb5..b4f0908d07b36 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23004. \344\272\214\347\273\264\346\225\260\347\273\204\344\270\255\347\232\204\346\237\245\346\211\276/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23004. \344\272\214\347\273\264\346\225\260\347\273\204\344\270\255\347\232\204\346\237\245\346\211\276/README.md"
@@ -62,6 +62,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def findNumberIn2DArray(self, matrix: List[List[int]], target: int) -> bool:
@@ -72,6 +74,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean findNumberIn2DArray(int[][] matrix, int target) {
@@ -86,6 +90,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -101,6 +107,8 @@ public:
};
```
+#### Go
+
```go
func findNumberIn2DArray(matrix [][]int, target int) bool {
for _, row := range matrix {
@@ -113,6 +121,8 @@ func findNumberIn2DArray(matrix [][]int, target int) bool {
}
```
+#### TypeScript
+
```ts
function findNumberIn2DArray(matrix: number[][], target: number): boolean {
if (matrix.length == 0 || matrix[0].length == 0) {
@@ -134,6 +144,8 @@ function findNumberIn2DArray(matrix: number[][], target: number): boolean {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
impl Solution {
@@ -161,6 +173,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -187,6 +201,8 @@ var findNumberIn2DArray = function (matrix, target) {
};
```
+#### C#
+
```cs
public class Solution {
public bool FindNumberIn2DArray(int[][] matrix, int target) {
@@ -228,6 +244,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def findNumberIn2DArray(self, matrix: List[List[int]], target: int) -> bool:
@@ -245,6 +263,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean findNumberIn2DArray(int[][] matrix, int target) {
@@ -267,6 +287,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -290,6 +312,8 @@ public:
};
```
+#### Go
+
```go
func findNumberIn2DArray(matrix [][]int, target int) bool {
if len(matrix) == 0 {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23005. \346\233\277\346\215\242\347\251\272\346\240\274/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23005. \346\233\277\346\215\242\347\251\272\346\240\274/README.md"
index 7858ce8bde4e3..3552a95538d74 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23005. \346\233\277\346\215\242\347\251\272\346\240\274/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23005. \346\233\277\346\215\242\347\251\272\346\240\274/README.md"
@@ -41,12 +41,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def replaceSpace(self, s: str) -> str:
return s.replace(' ', '%20')
```
+#### Java
+
```java
class Solution {
public String replaceSpace(String s) {
@@ -55,6 +59,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -71,18 +77,24 @@ public:
};
```
+#### Go
+
```go
func replaceSpace(s string) string {
return strings.Replace(s, " ", "%20", -1)
}
```
+#### TypeScript
+
```ts
function replaceSpace(s: string): string {
return s.replace(/\s/g, '%20');
}
```
+#### Rust
+
```rust
impl Solution {
pub fn replace_space(s: String) -> String {
@@ -91,6 +103,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -101,6 +115,8 @@ var replaceSpace = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public string ReplaceSpace(string s) {
@@ -109,6 +125,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -143,6 +161,8 @@ class Solution {
+#### Python3
+
```python
class Solution:
def replaceSpace(self, s: str) -> str:
@@ -152,6 +172,8 @@ class Solution:
return ''.join(ans)
```
+#### Java
+
```java
class Solution {
public String replaceSpace(String s) {
@@ -164,6 +186,8 @@ class Solution {
}
```
+#### Go
+
```go
func replaceSpace(s string) string {
ans := strings.Builder{}
@@ -178,6 +202,8 @@ func replaceSpace(s string) string {
}
```
+#### TypeScript
+
```ts
function replaceSpace(s: string): string {
const strArr = [];
@@ -188,6 +214,8 @@ function replaceSpace(s: string): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn replace_space(s: String) -> String {
@@ -204,6 +232,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -214,6 +244,8 @@ var replaceSpace = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public string ReplaceSpace(string s) {
@@ -240,6 +272,8 @@ public class Solution {
+#### JavaScript
+
```js
/**
* @param {string} s
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23006. \344\273\216\345\260\276\345\210\260\345\244\264\346\211\223\345\215\260\351\223\276\350\241\250/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23006. \344\273\216\345\260\276\345\210\260\345\244\264\346\211\223\345\215\260\351\223\276\350\241\250/README.md"
index 42b50ae3c3dc7..bfa8e8184131e 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23006. \344\273\216\345\260\276\345\210\260\345\244\264\346\211\223\345\215\260\351\223\276\350\241\250/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23006. \344\273\216\345\260\276\345\210\260\345\244\264\346\211\223\345\215\260\351\223\276\350\241\250/README.md"
@@ -41,6 +41,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -58,6 +60,8 @@ class Solution:
return ans[::-1]
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -82,6 +86,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -102,6 +108,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -121,6 +129,8 @@ func reversePrint(head *ListNode) (ans []int) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -143,6 +153,8 @@ function reversePrint(head: ListNode | null): number[] {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -174,6 +186,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -195,6 +209,8 @@ var reversePrint = function (head) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -231,6 +247,8 @@ var reversePrint = function (head) {
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -248,6 +266,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -274,6 +294,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -296,6 +318,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -314,6 +338,8 @@ func reversePrint(head *ListNode) (ans []int) {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -352,6 +378,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23007. \351\207\215\345\273\272\344\272\214\345\217\211\346\240\221/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23007. \351\207\215\345\273\272\344\272\214\345\217\211\346\240\221/README.md"
index 1f1f2f97d1031..d7ae1aa3cb80c 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23007. \351\207\215\345\273\272\344\272\214\345\217\211\346\240\221/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23007. \351\207\215\345\273\272\344\272\214\345\217\211\346\240\221/README.md"
@@ -64,6 +64,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -89,6 +91,8 @@ class Solution:
return dfs(0, 0, len(preorder))
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -128,6 +132,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -162,6 +168,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -192,6 +200,8 @@ func buildTree(preorder []int, inorder []int) *TreeNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -228,6 +238,8 @@ function buildTree(preorder: number[], inorder: number[]): TreeNode | null {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -276,6 +288,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -310,6 +324,8 @@ var buildTree = function (preorder, inorder) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
@@ -344,6 +360,8 @@ public class Solution {
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23009. \347\224\250\344\270\244\344\270\252\346\240\210\345\256\236\347\216\260\351\230\237\345\210\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23009. \347\224\250\344\270\244\344\270\252\346\240\210\345\256\236\347\216\260\351\230\237\345\210\227/README.md"
index b77ec1da1ff5a..be00711a0bbf9 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23009. \347\224\250\344\270\244\344\270\252\346\240\210\345\256\236\347\216\260\351\230\237\345\210\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23009. \347\224\250\344\270\244\344\270\252\346\240\210\345\256\236\347\216\260\351\230\237\345\210\227/README.md"
@@ -57,6 +57,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class CQueue:
def __init__(self):
@@ -79,6 +81,8 @@ class CQueue:
# param_2 = obj.deleteHead()
```
+#### Java
+
```java
class CQueue {
private Deque stk1 = new ArrayDeque<>();
@@ -109,6 +113,8 @@ class CQueue {
*/
```
+#### C++
+
```cpp
class CQueue {
public:
@@ -146,6 +152,8 @@ private:
*/
```
+#### Go
+
```go
type CQueue struct {
stk1, stk2 []int
@@ -182,6 +190,8 @@ func (this *CQueue) DeleteHead() int {
*/
```
+#### TypeScript
+
```ts
class CQueue {
private stk1: number[];
@@ -214,6 +224,8 @@ class CQueue {
*/
```
+#### Rust
+
```rust
struct CQueue {
s1: Vec,
@@ -255,6 +267,8 @@ impl CQueue {
*/
```
+#### JavaScript
+
```js
var CQueue = function () {
this.stk1 = [];
@@ -289,6 +303,8 @@ CQueue.prototype.deleteHead = function () {
*/
```
+#### C#
+
```cs
public class CQueue {
private Stack stk1 = new Stack();
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23010- I. \346\226\220\346\263\242\351\202\243\345\245\221\346\225\260\345\210\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23010- I. \346\226\220\346\263\242\351\202\243\345\245\221\346\225\260\345\210\227/README.md"
index e4579605027ef..7d38e46f39ac0 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23010- I. \346\226\220\346\263\242\351\202\243\345\245\221\346\225\260\345\210\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23010- I. \346\226\220\346\263\242\351\202\243\345\245\221\346\225\260\345\210\227/README.md"
@@ -60,6 +60,8 @@ F(N) = F(N - 1) + F(N - 2), 其中 N > 1.
+#### Python3
+
```python
class Solution:
def fib(self, n: int) -> int:
@@ -69,6 +71,8 @@ class Solution:
return a
```
+#### Java
+
```java
class Solution {
public int fib(int n) {
@@ -83,6 +87,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -98,6 +104,8 @@ public:
};
```
+#### Go
+
```go
func fib(n int) int {
a, b := 0, 1
@@ -108,6 +116,8 @@ func fib(n int) int {
}
```
+#### TypeScript
+
```ts
function fib(n: number): number {
let a: number = 0,
@@ -120,6 +130,8 @@ function fib(n: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn fib(n: i32) -> i32 {
@@ -132,6 +144,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -147,6 +161,8 @@ var fib = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int Fib(int n) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23010- II. \351\235\222\350\233\231\350\267\263\345\217\260\351\230\266\351\227\256\351\242\230/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23010- II. \351\235\222\350\233\231\350\267\263\345\217\260\351\230\266\351\227\256\351\242\230/README.md"
index 96e87f80406ed..f28acba85bfa2 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23010- II. \351\235\222\350\233\231\350\267\263\345\217\260\351\230\266\351\227\256\351\242\230/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23010- II. \351\235\222\350\233\231\350\267\263\345\217\260\351\230\266\351\227\256\351\242\230/README.md"
@@ -59,6 +59,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def numWays(self, n: int) -> int:
@@ -68,6 +70,8 @@ class Solution:
return a
```
+#### Java
+
```java
class Solution {
public int numWays(int n) {
@@ -82,6 +86,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -97,6 +103,8 @@ public:
};
```
+#### Go
+
```go
func numWays(n int) int {
a, b := 1, 1
@@ -107,6 +115,8 @@ func numWays(n int) int {
}
```
+#### TypeScript
+
```ts
function numWays(n: number): number {
let a = 0;
@@ -118,6 +128,8 @@ function numWays(n: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn num_ways(n: i32) -> i32 {
@@ -130,6 +142,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -144,6 +158,8 @@ var numWays = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int NumWays(int n) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23011. \346\227\213\350\275\254\346\225\260\347\273\204\347\232\204\346\234\200\345\260\217\346\225\260\345\255\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23011. \346\227\213\350\275\254\346\225\260\347\273\204\347\232\204\346\234\200\345\260\217\346\225\260\345\255\227/README.md"
index ea14870f02d1e..2f94ffeb0654b 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23011. \346\227\213\350\275\254\346\225\260\347\273\204\347\232\204\346\234\200\345\260\217\346\225\260\345\255\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23011. \346\227\213\350\275\254\346\225\260\347\273\204\347\232\204\346\234\200\345\260\217\346\225\260\345\255\227/README.md"
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def minArray(self, numbers: List[int]) -> int:
@@ -71,6 +73,8 @@ class Solution:
return numbers[l]
```
+#### Java
+
```java
class Solution {
public int minArray(int[] numbers) {
@@ -90,6 +94,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -110,6 +116,8 @@ public:
};
```
+#### Go
+
```go
func minArray(numbers []int) int {
l, r := 0, len(numbers)-1
@@ -127,6 +135,8 @@ func minArray(numbers []int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn min_array(numbers: Vec) -> i32 {
@@ -151,6 +161,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} numbers
@@ -173,6 +185,8 @@ var minArray = function (numbers) {
};
```
+#### C#
+
```cs
public class Solution {
public int MinArray(int[] numbers) {
@@ -202,6 +216,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def minArray(self, numbers: List[int]) -> int:
@@ -219,6 +235,8 @@ class Solution:
return numbers[l]
```
+#### Java
+
```java
class Solution {
public int minArray(int[] numbers) {
@@ -241,6 +259,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -264,6 +284,8 @@ public:
};
```
+#### Go
+
```go
func minArray(numbers []int) int {
l, r := 0, len(numbers)-1
@@ -284,6 +306,8 @@ func minArray(numbers []int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn min_array(numbers: Vec) -> i32 {
@@ -311,6 +335,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} numbers
@@ -336,6 +362,8 @@ var minArray = function (numbers) {
};
```
+#### C#
+
```cs
public class Solution {
public int MinArray(int[] numbers) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23012. \347\237\251\351\230\265\344\270\255\347\232\204\350\267\257\345\276\204/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23012. \347\237\251\351\230\265\344\270\255\347\232\204\350\267\257\345\276\204/README.md"
index cc74cf66322f2..f664835e0af45 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23012. \347\237\251\351\230\265\344\270\255\347\232\204\350\267\257\345\276\204/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23012. \347\237\251\351\230\265\344\270\255\347\232\204\350\267\257\345\276\204/README.md"
@@ -74,6 +74,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def exist(self, board: List[List[str]], word: str) -> bool:
@@ -92,6 +94,8 @@ class Solution:
return any(dfs(i, j, 0) for i in range(m) for j in range(n))
```
+#### Java
+
```java
class Solution {
private char[][] board;
@@ -133,6 +137,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -166,6 +172,8 @@ public:
};
```
+#### Go
+
```go
func exist(board [][]byte, word string) bool {
m, n := len(board), len(board[0])
@@ -197,6 +205,8 @@ func exist(board [][]byte, word string) bool {
}
```
+#### TypeScript
+
```ts
function exist(board: string[][], word: string): boolean {
const m = board.length;
@@ -227,6 +237,8 @@ function exist(board: string[][], word: string): boolean {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(
@@ -273,6 +285,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {character[][]} board
@@ -309,6 +323,8 @@ var exist = function (board, word) {
};
```
+#### C#
+
```cs
public class Solution {
private char[][] board;
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23013. \346\234\272\345\231\250\344\272\272\347\232\204\350\277\220\345\212\250\350\214\203\345\233\264/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23013. \346\234\272\345\231\250\344\272\272\347\232\204\350\277\220\345\212\250\350\214\203\345\233\264/README.md"
index b4b67d6afee48..23012d40d2e97 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23013. \346\234\272\345\231\250\344\272\272\347\232\204\350\277\220\345\212\250\350\214\203\345\233\264/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23013. \346\234\272\345\231\250\344\272\272\347\232\204\350\277\220\345\212\250\350\214\203\345\233\264/README.md"
@@ -51,6 +51,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def movingCount(self, m: int, n: int, k: int) -> int:
@@ -77,6 +79,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private boolean[][] vis;
@@ -116,6 +120,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -147,6 +153,8 @@ public:
};
```
+#### Go
+
```go
func movingCount(m int, n int, k int) int {
vis := make([][]bool, m)
@@ -165,6 +173,8 @@ func movingCount(m int, n int, k int) int {
}
```
+#### TypeScript
+
```ts
function movingCount(m: number, n: number, k: number): number {
const set = new Set();
@@ -187,6 +197,8 @@ function movingCount(m: number, n: number, k: number): number {
}
```
+#### Rust
+
```rust
use std::collections::{ HashSet, VecDeque };
impl Solution {
@@ -217,6 +229,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} m
@@ -242,6 +256,8 @@ var movingCount = function (m, n, k) {
};
```
+#### C#
+
```cs
public class Solution {
public int MovingCount(int m, int n, int k) {
@@ -269,6 +285,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def movingCount(self, m: int, n: int, k: int) -> int:
@@ -289,6 +307,8 @@ class Solution:
return dfs(0, 0)
```
+#### Java
+
```java
class Solution {
private boolean[][] vis;
@@ -314,6 +334,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -339,6 +361,8 @@ public:
};
```
+#### Go
+
```go
func movingCount(m int, n int, k int) (ans int) {
f := func(x int) (s int) {
@@ -369,6 +393,8 @@ func movingCount(m int, n int, k int) (ans int) {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(sign: &mut Vec>, k: usize, i: usize, j: usize) -> i32 {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23014- I. \345\211\252\347\273\263\345\255\220/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23014- I. \345\211\252\347\273\263\345\255\220/README.md"
index 70c4f61568753..82dc195744012 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23014- I. \345\211\252\347\273\263\345\255\220/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23014- I. \345\211\252\347\273\263\345\255\220/README.md"
@@ -54,6 +54,8 @@ $$
+#### Python3
+
```python
class Solution:
def cuttingRope(self, n: int) -> int:
@@ -64,6 +66,8 @@ class Solution:
return dp[n]
```
+#### Java
+
```java
class Solution {
public int cuttingRope(int n) {
@@ -79,6 +83,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -95,6 +101,8 @@ public:
};
```
+#### Go
+
```go
func cuttingRope(n int) int {
dp := make([]int, n+1)
@@ -108,6 +116,8 @@ func cuttingRope(n int) int {
}
```
+#### TypeScript
+
```ts
function cuttingRope(n: number): number {
if (n < 4) {
@@ -124,6 +134,8 @@ function cuttingRope(n: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn cutting_rope(n: i32) -> i32 {
@@ -136,6 +148,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -156,6 +170,8 @@ var cuttingRope = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int CuttingRope(int n) {
@@ -187,6 +203,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def cuttingRope(self, n: int) -> int:
@@ -199,6 +217,8 @@ class Solution:
return pow(3, n // 3) * 2
```
+#### Java
+
```java
class Solution {
public int cuttingRope(int n) {
@@ -216,6 +236,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -234,6 +256,8 @@ public:
};
```
+#### Go
+
```go
func cuttingRope(n int) int {
if n < 4 {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23014- II. \345\211\252\347\273\263\345\255\220 II/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23014- II. \345\211\252\347\273\263\345\255\220 II/README.md"
index 4f85ffd2ec236..67dabbe6f5408 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23014- II. \345\211\252\347\273\263\345\255\220 II/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23014- II. \345\211\252\347\273\263\345\255\220 II/README.md"
@@ -54,6 +54,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def cuttingRope(self, n: int) -> int:
@@ -67,6 +69,8 @@ class Solution:
return pow(3, n // 3, mod) * 2 % mod
```
+#### Java
+
```java
class Solution {
private final int mod = (int) 1e9 + 7;
@@ -97,6 +101,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
func cuttingRope(n int) int {
if n < 4 {
@@ -152,6 +160,8 @@ func cuttingRope(n int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn cutting_rope(mut n: i32) -> i32 {
@@ -168,6 +178,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -199,6 +211,8 @@ var cuttingRope = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int CuttingRope(int n) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23015. \344\272\214\350\277\233\345\210\266\344\270\2551\347\232\204\344\270\252\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23015. \344\272\214\350\277\233\345\210\266\344\270\2551\347\232\204\344\270\252\346\225\260/README.md"
index 2d0681dc10521..95b67801c3b94 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23015. \344\272\214\350\277\233\345\210\266\344\270\2551\347\232\204\344\270\252\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23015. \344\272\214\350\277\233\345\210\266\344\270\2551\347\232\204\344\270\252\346\225\260/README.md"
@@ -76,12 +76,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def hammingWeight(self, n: int) -> int:
return n.bit_count()
```
+#### Java
+
```java
public class Solution {
// you need to treat n as an unsigned value
@@ -96,6 +100,8 @@ public class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -110,6 +116,8 @@ public:
};
```
+#### Go
+
```go
func hammingWeight(num uint32) (ans int) {
for num != 0 {
@@ -120,6 +128,8 @@ func hammingWeight(num uint32) (ans int) {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n - a positive integer
@@ -135,6 +145,8 @@ var hammingWeight = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int HammingWeight(uint n) {
@@ -158,6 +170,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def hammingWeight(self, n: int) -> int:
@@ -168,6 +182,8 @@ class Solution:
return ans
```
+#### Java
+
```java
public class Solution {
// you need to treat n as an unsigned value
@@ -182,6 +198,8 @@ public class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -196,6 +214,8 @@ public:
};
```
+#### Go
+
```go
func hammingWeight(num uint32) (ans int) {
for num != 0 {
@@ -216,6 +236,8 @@ func hammingWeight(num uint32) (ans int) {
+#### Python3
+
```python
class Solution:
def hammingWeight(self, n: int) -> int:
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23016. \346\225\260\345\200\274\347\232\204\346\225\264\346\225\260\346\254\241\346\226\271/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23016. \346\225\260\345\200\274\347\232\204\346\225\264\346\225\260\346\254\241\346\226\271/README.md"
index 92588fa8cc04a..1808d49592873 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23016. \346\225\260\345\200\274\347\232\204\346\225\264\346\225\260\346\254\241\346\226\271/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23016. \346\225\260\345\200\274\347\232\204\346\225\264\346\225\260\346\254\241\346\226\271/README.md"
@@ -64,6 +64,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def myPow(self, x: float, n: int) -> float:
@@ -79,6 +81,8 @@ class Solution:
return qpow(x, n) if n >= 0 else 1 / qpow(x, -n)
```
+#### Java
+
```java
class Solution {
public double myPow(double x, int n) {
@@ -98,6 +102,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -117,6 +123,8 @@ public:
};
```
+#### Go
+
```go
func myPow(x float64, n int) float64 {
qpow := func(a float64, n int) float64 {
@@ -136,6 +144,8 @@ func myPow(x float64, n int) float64 {
}
```
+#### TypeScript
+
```ts
function myPow(x: number, n: number): number {
const qpow = (a: number, n: number): number => {
@@ -152,6 +162,8 @@ function myPow(x: number, n: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
#[allow(dead_code)]
@@ -181,6 +193,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} x
@@ -202,6 +216,8 @@ var myPow = function (x, n) {
};
```
+#### C#
+
```cs
public class Solution {
public double MyPow(double x, int n) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23017. \346\211\223\345\215\260\344\273\2161\345\210\260\346\234\200\345\244\247\347\232\204n\344\275\215\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23017. \346\211\223\345\215\260\344\273\2161\345\210\260\346\234\200\345\244\247\347\232\204n\344\275\215\346\225\260/README.md"
index 71fc0fefc2eb6..263db1db585bd 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23017. \346\211\223\345\215\260\344\273\2161\345\210\260\346\234\200\345\244\247\347\232\204n\344\275\215\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23017. \346\211\223\345\215\260\344\273\2161\345\210\260\346\234\200\345\244\247\347\232\204n\344\275\215\346\225\260/README.md"
@@ -45,6 +45,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def printNumbers(self, n: int) -> List[int]:
@@ -69,6 +71,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] printNumbers(int n) {
@@ -104,6 +108,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
func printNumbers(n int) []int {
n = int(math.Pow(10, float64(n))) - 1
@@ -173,6 +181,8 @@ func print(n int) []string {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -187,6 +197,8 @@ var printNumbers = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] PrintNumbers(int n) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23018. \345\210\240\351\231\244\351\223\276\350\241\250\347\232\204\350\212\202\347\202\271/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23018. \345\210\240\351\231\244\351\223\276\350\241\250\347\232\204\350\212\202\347\202\271/README.md"
index ec8ffb1dd2ecb..41be8be5e9e37 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23018. \345\210\240\351\231\244\351\223\276\350\241\250\347\232\204\350\212\202\347\202\271/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23018. \345\210\240\351\231\244\351\223\276\350\241\250\347\232\204\350\212\202\347\202\271/README.md"
@@ -59,6 +59,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -76,6 +78,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -99,6 +103,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -123,6 +129,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -143,6 +151,8 @@ func deleteNode(head *ListNode, val int) *ListNode {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -175,6 +185,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -200,6 +212,8 @@ var deleteNode = function (head, val) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23019. \346\255\243\345\210\231\350\241\250\350\276\276\345\274\217\345\214\271\351\205\215/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23019. \346\255\243\345\210\231\350\241\250\350\276\276\345\274\217\345\214\271\351\205\215/README.md"
index c3b17044e54ba..f1a510583f5fb 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23019. \346\255\243\345\210\231\350\241\250\350\276\276\345\274\217\345\214\271\351\205\215/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23019. \346\255\243\345\210\231\350\241\250\350\276\276\345\274\217\345\214\271\351\205\215/README.md"
@@ -86,6 +86,8 @@ p = "mis*is*p*."
+#### Python3
+
```python
class Solution:
def isMatch(self, s: str, p: str) -> bool:
@@ -103,6 +105,8 @@ class Solution:
return dfs(0, 0)
```
+#### Java
+
```java
class Solution {
private Boolean[][] f;
@@ -139,6 +143,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -169,6 +175,8 @@ public:
};
```
+#### Go
+
```go
func isMatch(s string, p string) bool {
m, n := len(s), len(p)
@@ -199,6 +207,8 @@ func isMatch(s string, p string) bool {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -231,6 +241,8 @@ var isMatch = function (s, p) {
};
```
+#### C#
+
```cs
public class Solution {
private string s;
@@ -290,6 +302,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def isMatch(self, s: str, p: str) -> bool:
@@ -307,6 +321,8 @@ class Solution:
return f[m][n]
```
+#### Java
+
```java
class Solution {
public boolean isMatch(String s, String p) {
@@ -331,6 +347,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -356,6 +374,8 @@ public:
};
```
+#### Go
+
```go
func isMatch(s string, p string) bool {
m, n := len(s), len(p)
@@ -380,6 +400,8 @@ func isMatch(s string, p string) bool {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -407,6 +429,8 @@ var isMatch = function (s, p) {
};
```
+#### C#
+
```cs
public class Solution {
public bool IsMatch(string s, string p) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23020. \350\241\250\347\244\272\346\225\260\345\200\274\347\232\204\345\255\227\347\254\246\344\270\262/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23020. \350\241\250\347\244\272\346\225\260\345\200\274\347\232\204\345\255\227\347\254\246\344\270\262/README.md"
index 73a739a2c4fac..77c6e13277a5c 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23020. \350\241\250\347\244\272\346\225\260\345\200\274\347\232\204\345\255\227\347\254\246\344\270\262/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23020. \350\241\250\347\244\272\346\225\260\345\200\274\347\232\204\345\255\227\347\254\246\344\270\262/README.md"
@@ -123,6 +123,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def isNumber(self, s: str) -> bool:
@@ -154,6 +156,8 @@ class Solution:
return digit
```
+#### Java
+
```java
class Solution {
public boolean isNumber(String s) {
@@ -198,6 +202,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -240,6 +246,8 @@ public:
};
```
+#### Go
+
```go
func isNumber(s string) bool {
i, j := 0, len(s)-1
@@ -278,6 +286,8 @@ func isNumber(s string) bool {
}
```
+#### C#
+
```cs
public class Solution {
public bool IsNumber(string s) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23021. \350\260\203\346\225\264\346\225\260\347\273\204\351\241\272\345\272\217\344\275\277\345\245\207\346\225\260\344\275\215\344\272\216\345\201\266\346\225\260\345\211\215\351\235\242/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23021. \350\260\203\346\225\264\346\225\260\347\273\204\351\241\272\345\272\217\344\275\277\345\245\207\346\225\260\344\275\215\344\272\216\345\201\266\346\225\260\345\211\215\351\235\242/README.md"
index 45edb581972bb..82bd886900fb0 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23021. \350\260\203\346\225\264\346\225\260\347\273\204\351\241\272\345\272\217\344\275\277\345\245\207\346\225\260\344\275\215\344\272\216\345\201\266\346\225\260\345\211\215\351\235\242/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23021. \350\260\203\346\225\264\346\225\260\347\273\204\351\241\272\345\272\217\344\275\277\345\245\207\346\225\260\344\275\215\344\272\216\345\201\266\346\225\260\345\211\215\351\235\242/README.md"
@@ -48,6 +48,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def exchange(self, nums: List[int]) -> List[int]:
@@ -59,6 +61,8 @@ class Solution:
return nums
```
+#### Java
+
```java
class Solution {
public int[] exchange(int[] nums) {
@@ -75,6 +79,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -90,6 +96,8 @@ public:
};
```
+#### Go
+
```go
func exchange(nums []int) []int {
j := 0
@@ -103,6 +111,8 @@ func exchange(nums []int) []int {
}
```
+#### TypeScript
+
```ts
function exchange(nums: number[]): number[] {
let j = 0;
@@ -117,6 +127,8 @@ function exchange(nums: number[]): number[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn exchange(mut nums: Vec) -> Vec {
@@ -132,6 +144,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -150,6 +164,8 @@ var exchange = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] Exchange(int[] nums) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23022. \351\223\276\350\241\250\344\270\255\345\200\222\346\225\260\347\254\254k\344\270\252\350\212\202\347\202\271/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23022. \351\223\276\350\241\250\344\270\255\345\200\222\346\225\260\347\254\254k\344\270\252\350\212\202\347\202\271/README.md"
index b7cec862d8029..01b493c023c0a 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23022. \351\223\276\350\241\250\344\270\255\345\200\222\346\225\260\347\254\254k\344\270\252\350\212\202\347\202\271/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23022. \351\223\276\350\241\250\344\270\255\345\200\222\346\225\260\347\254\254k\344\270\252\350\212\202\347\202\271/README.md"
@@ -41,6 +41,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -59,6 +61,8 @@ class Solution:
return slow
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -83,6 +87,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -108,6 +114,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -128,6 +136,8 @@ func getKthFromEnd(head *ListNode, k int) *ListNode {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -161,6 +171,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -188,6 +200,8 @@ var getKthFromEnd = function (head, k) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23024. \345\217\215\350\275\254\351\223\276\350\241\250/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23024. \345\217\215\350\275\254\351\223\276\350\241\250/README.md"
index bb682f1185f39..eb47b51e25097 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23024. \345\217\215\350\275\254\351\223\276\350\241\250/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23024. \345\217\215\350\275\254\351\223\276\350\241\250/README.md"
@@ -45,6 +45,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -65,6 +67,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -89,6 +93,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -114,6 +120,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -135,6 +143,8 @@ func reverseList(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -161,6 +171,8 @@ function reverseList(head: ListNode | null): ListNode | null {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -193,6 +205,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -218,6 +232,8 @@ var reverseList = function (head) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -256,6 +272,8 @@ public class Solution {
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -274,6 +292,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -296,6 +316,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -319,6 +341,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -338,6 +362,8 @@ func reverseList(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -362,6 +388,8 @@ function reverseList(head: ListNode | null): ListNode | null {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -385,6 +413,8 @@ var reverseList = function (head) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23025. \345\220\210\345\271\266\344\270\244\344\270\252\346\216\222\345\272\217\347\232\204\351\223\276\350\241\250/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23025. \345\220\210\345\271\266\344\270\244\344\270\252\346\216\222\345\272\217\347\232\204\351\223\276\350\241\250/README.md"
index 1140ecabde6c4..d33eeadb54e40 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23025. \345\220\210\345\271\266\344\270\244\344\270\252\346\216\222\345\272\217\347\232\204\351\223\276\350\241\250/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23025. \345\220\210\345\271\266\344\270\244\344\270\252\346\216\222\345\272\217\347\232\204\351\223\276\350\241\250/README.md"
@@ -43,6 +43,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -66,6 +68,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -95,6 +99,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -125,6 +131,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -155,6 +163,8 @@ func mergeTwoLists(l1 *ListNode, l2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -186,6 +196,8 @@ function mergeTwoLists(l1: ListNode | null, l2: ListNode | null): ListNode | nul
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -235,6 +247,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -266,6 +280,8 @@ var mergeTwoLists = function (l1, l2) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -314,6 +330,8 @@ public class Solution {
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -334,6 +352,8 @@ class Solution:
return l2
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -362,6 +382,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -391,6 +413,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -416,6 +440,8 @@ func mergeTwoLists(l1 *ListNode, l2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -442,6 +468,8 @@ function mergeTwoLists(l1: ListNode | null, l2: ListNode | null): ListNode | nul
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -482,6 +510,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -509,6 +539,8 @@ var mergeTwoLists = function (l1, l2) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23026. \346\240\221\347\232\204\345\255\220\347\273\223\346\236\204/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23026. \346\240\221\347\232\204\345\255\220\347\273\223\346\236\204/README.md"
index c334a95c9662b..84e16d479c851 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23026. \346\240\221\347\232\204\345\255\220\347\273\223\346\236\204/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23026. \346\240\221\347\232\204\345\255\220\347\273\223\346\236\204/README.md"
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -81,6 +83,8 @@ class Solution:
return self.isSubStructure(A.left, B) or self.isSubStructure(A.right, B)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -111,6 +115,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -163,6 +171,8 @@ func isSubStructure(A *TreeNode, B *TreeNode) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -195,6 +205,8 @@ function isSubStructure(A: TreeNode | null, B: TreeNode | null): boolean {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -251,6 +263,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -281,6 +295,8 @@ var isSubStructure = function (A, B) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23027. \344\272\214\345\217\211\346\240\221\347\232\204\351\225\234\345\203\217/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23027. \344\272\214\345\217\211\346\240\221\347\232\204\351\225\234\345\203\217/README.md"
index aedf7ac2a1d0e..3777ac1f3556e 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23027. \344\272\214\345\217\211\346\240\221\347\232\204\351\225\234\345\203\217/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23027. \344\272\214\345\217\211\346\240\221\347\232\204\351\225\234\345\203\217/README.md"
@@ -59,6 +59,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -78,6 +80,8 @@ class Solution:
return root
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -103,6 +107,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -127,6 +133,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -147,6 +155,8 @@ func mirrorTree(root *TreeNode) *TreeNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -175,6 +185,8 @@ function mirrorTree(root: TreeNode | null): TreeNode | null {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -215,6 +227,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -240,6 +254,8 @@ var mirrorTree = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
@@ -275,6 +291,8 @@ public class Solution {
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23028. \345\257\271\347\247\260\347\232\204\344\272\214\345\217\211\346\240\221/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23028. \345\257\271\347\247\260\347\232\204\344\272\214\345\217\211\346\240\221/README.md"
index 910e8d93acff5..dd282178ab3ba 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23028. \345\257\271\347\247\260\347\232\204\344\272\214\345\217\211\346\240\221/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23028. \345\257\271\347\247\260\347\232\204\344\272\214\345\217\211\346\240\221/README.md"
@@ -71,6 +71,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -92,6 +94,8 @@ class Solution:
return dfs(root, root)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -119,6 +123,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -146,6 +152,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -170,6 +178,8 @@ func isSymmetric(root *TreeNode) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -199,6 +209,8 @@ function isSymmetric(root: TreeNode | null): boolean {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -239,6 +251,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -265,6 +279,8 @@ var isSymmetric = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23029. \351\241\272\346\227\266\351\222\210\346\211\223\345\215\260\347\237\251\351\230\265/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23029. \351\241\272\346\227\266\351\222\210\346\211\223\345\215\260\347\237\251\351\230\265/README.md"
index 929cdce9d9f7a..c91788e2f795f 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23029. \351\241\272\346\227\266\351\222\210\346\211\223\345\215\260\347\237\251\351\230\265/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23029. \351\241\272\346\227\266\351\222\210\346\211\223\345\215\260\347\237\251\351\230\265/README.md"
@@ -53,6 +53,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def spiralOrder(self, matrix: List[List[int]]) -> List[int]:
@@ -74,6 +76,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] spiralOrder(int[][] matrix) {
@@ -102,6 +106,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -132,6 +138,8 @@ public:
};
```
+#### Go
+
```go
func spiralOrder(matrix [][]int) []int {
if len(matrix) == 0 || len(matrix[0]) == 0 {
@@ -159,6 +167,8 @@ func spiralOrder(matrix [][]int) []int {
}
```
+#### TypeScript
+
```ts
var spiralOrder = (matrix: number[][]): number[] => {
let ans: number[] = [];
@@ -185,6 +195,8 @@ var spiralOrder = (matrix: number[][]): number[] => {
};
```
+#### Rust
+
```rust
impl Solution {
pub fn spiral_order(matrix: Vec>) -> Vec {
@@ -233,6 +245,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} matrix
@@ -267,6 +281,8 @@ var spiralOrder = function (matrix) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] SpiralOrder(int[][] matrix) {
@@ -324,6 +340,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def spiralOrder(self, matrix: List[List[int]]) -> List[int]:
@@ -342,6 +360,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] spiralOrder(int[][] matrix) {
@@ -377,6 +397,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -404,6 +426,8 @@ public:
};
```
+#### Go
+
```go
func spiralOrder(matrix [][]int) []int {
if len(matrix) == 0 || len(matrix[0]) == 0 {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23030. \345\214\205\345\220\253min\345\207\275\346\225\260\347\232\204\346\240\210/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23030. \345\214\205\345\220\253min\345\207\275\346\225\260\347\232\204\346\240\210/README.md"
index f548c50e64696..c0920da92f184 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23030. \345\214\205\345\220\253min\345\207\275\346\225\260\347\232\204\346\240\210/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23030. \345\214\205\345\220\253min\345\207\275\346\225\260\347\232\204\346\240\210/README.md"
@@ -57,6 +57,8 @@ minStack.min(); --> 返回 -2.
+#### Python3
+
```python
class MinStack:
def __init__(self):
@@ -90,6 +92,8 @@ class MinStack:
+#### Java
+
```java
class MinStack {
private Deque stk1 = new ArrayDeque<>();
@@ -131,6 +135,8 @@ class MinStack {
### **C++**
+#### C++
+
```cpp
class MinStack {
public:
@@ -174,6 +180,8 @@ private:
### **Go**
+#### Go
+
```go
type MinStack struct {
stk1 []int
@@ -215,6 +223,8 @@ func (this *MinStack) GetMin() int {
### **TypeScript**
+#### TypeScript
+
```ts
class MinStack {
stack: number[];
@@ -255,6 +265,8 @@ class MinStack {
### **Rust**
+#### Rust
+
```rust
use std::collections::VecDeque;
struct MinStack {
@@ -305,6 +317,8 @@ impl MinStack {
### **C#**
+#### C#
+
```cs
public class MinStack {
private Stack stk1 = new Stack();
@@ -364,6 +378,8 @@ public class MinStack {
+#### Python3
+
```python
class MinStack:
def __init__(self):
@@ -393,6 +409,8 @@ class MinStack:
# param_4 = obj.getMin()
```
+#### Java
+
```java
class MinStack {
private Deque stk1 = new ArrayDeque<>();
@@ -432,6 +450,8 @@ class MinStack {
*/
```
+#### C++
+
```cpp
class MinStack {
public:
@@ -473,6 +493,8 @@ private:
*/
```
+#### Go
+
```go
type MinStack struct {
stk1 []int
@@ -512,6 +534,8 @@ func (this *MinStack) GetMin() int {
*/
```
+#### TypeScript
+
```ts
class MinStack {
stack: number[];
@@ -550,6 +574,8 @@ class MinStack {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
struct MinStack {
@@ -598,6 +624,8 @@ impl MinStack {
*/
```
+#### JavaScript
+
```js
/**
* initialize your data structure here.
@@ -651,6 +679,8 @@ MinStack.prototype.min = function () {
*/
```
+#### C#
+
```cs
public class MinStack {
private Stack stk1 = new Stack();
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23031. \346\240\210\347\232\204\345\216\213\345\205\245\343\200\201\345\274\271\345\207\272\345\272\217\345\210\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23031. \346\240\210\347\232\204\345\216\213\345\205\245\343\200\201\345\274\271\345\207\272\345\272\217\345\210\227/README.md"
index a157007e7f45b..b79a3701dc30c 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23031. \346\240\210\347\232\204\345\216\213\345\205\245\343\200\201\345\274\271\345\207\272\345\272\217\345\210\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23031. \346\240\210\347\232\204\345\216\213\345\205\245\343\200\201\345\274\271\345\207\272\345\272\217\345\210\227/README.md"
@@ -60,6 +60,8 @@ push(5), pop() -> 5, pop() -> 3, pop() -> 2, pop() -> 1
+#### Python3
+
```python
class Solution:
def validateStackSequences(self, pushed: List[int], popped: List[int]) -> bool:
@@ -72,6 +74,8 @@ class Solution:
return j == len(pushed)
```
+#### Java
+
```java
class Solution {
public boolean validateStackSequences(int[] pushed, int[] popped) {
@@ -89,6 +93,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -107,6 +113,8 @@ public:
};
```
+#### Go
+
```go
func validateStackSequences(pushed []int, popped []int) bool {
stk := []int{}
@@ -122,6 +130,8 @@ func validateStackSequences(pushed []int, popped []int) bool {
}
```
+#### TypeScript
+
```ts
function validateStackSequences(pushed: number[], popped: number[]): boolean {
const stk = [];
@@ -137,6 +147,8 @@ function validateStackSequences(pushed: number[], popped: number[]): boolean {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn validate_stack_sequences(pushed: Vec, popped: Vec) -> bool {
@@ -154,6 +166,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} pushed
@@ -174,6 +188,8 @@ var validateStackSequences = function (pushed, popped) {
};
```
+#### C#
+
```cs
public class Solution {
public bool ValidateStackSequences(int[] pushed, int[] popped) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23032 - I. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23032 - I. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221/README.md"
index 1b73f52ccc63f..cb59cd46a82cd 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23032 - I. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23032 - I. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221/README.md"
@@ -53,6 +53,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -79,6 +81,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -154,6 +160,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -185,6 +193,8 @@ func levelOrder(root *TreeNode) (ans []int) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -216,6 +226,8 @@ function levelOrder(root: TreeNode | null): number[] {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -260,6 +272,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -290,6 +304,8 @@ var levelOrder = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23032 - II. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 II/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23032 - II. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 II/README.md"
index a84eaa9c6af87..5abd0fc0fdcb3 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23032 - II. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 II/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23032 - II. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 II/README.md"
@@ -64,6 +64,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -92,6 +94,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -129,6 +133,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -161,6 +167,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -194,6 +202,8 @@ func levelOrder(root *TreeNode) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -230,6 +240,8 @@ function levelOrder(root: TreeNode | null): number[][] {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -281,6 +293,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -313,6 +327,8 @@ var levelOrder = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23032 - III. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 III/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23032 - III. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 III/README.md"
index 5d238f2d5d32c..4ab03e4237ee2 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23032 - III. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 III/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23032 - III. \344\273\216\344\270\212\345\210\260\344\270\213\346\211\223\345\215\260\344\272\214\345\217\211\346\240\221 III/README.md"
@@ -57,6 +57,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -86,6 +88,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -126,6 +130,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -167,6 +173,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -205,6 +213,8 @@ func levelOrder(root *TreeNode) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -243,6 +253,8 @@ function levelOrder(root: TreeNode | null): number[][] {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -299,6 +311,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -334,6 +348,8 @@ var levelOrder = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23033. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\345\220\216\345\272\217\351\201\215\345\216\206\345\272\217\345\210\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23033. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\345\220\216\345\272\217\351\201\215\345\216\206\345\272\217\345\210\227/README.md"
index eb80df2e3a572..c7999fe246a86 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23033. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\345\220\216\345\272\217\351\201\215\345\216\206\345\272\217\345\210\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23033. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\345\220\216\345\272\217\351\201\215\345\216\206\345\272\217\345\210\227/README.md"
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def verifyPostorder(self, postorder: List[int]) -> bool:
@@ -73,6 +75,8 @@ class Solution:
return dfs(0, len(postorder) - 1)
```
+#### Java
+
```java
class Solution {
private int[] postorder;
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
func verifyPostorder(postorder []int) bool {
var dfs func(l, r int) bool
@@ -149,6 +157,8 @@ func verifyPostorder(postorder []int) bool {
}
```
+#### TypeScript
+
```ts
function verifyPostorder(postorder: number[]): boolean {
const dfs = (l: number, r: number): boolean => {
@@ -171,6 +181,8 @@ function verifyPostorder(postorder: number[]): boolean {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(start: usize, end: usize, max_val: i32, postorder: &Vec) -> bool {
@@ -199,6 +211,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} postorder
@@ -225,6 +239,8 @@ var verifyPostorder = function (postorder) {
};
```
+#### C#
+
```cs
public class Solution {
private int[] postorder;
@@ -280,6 +296,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def verifyPostorder(self, postorder: List[int]) -> bool:
@@ -294,6 +312,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
public boolean verifyPostorder(int[] postorder) {
@@ -314,6 +334,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -336,6 +358,8 @@ public:
};
```
+#### Go
+
```go
func verifyPostorder(postorder []int) bool {
mx := 1 << 30
@@ -355,6 +379,8 @@ func verifyPostorder(postorder []int) bool {
}
```
+#### TypeScript
+
```ts
function verifyPostorder(postorder: number[]): boolean {
let mx = 1 << 30;
@@ -373,6 +399,8 @@ function verifyPostorder(postorder: number[]): boolean {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} postorder
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23034. \344\272\214\345\217\211\346\240\221\344\270\255\345\222\214\344\270\272\346\237\220\344\270\200\345\200\274\347\232\204\350\267\257\345\276\204/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23034. \344\272\214\345\217\211\346\240\221\344\270\255\345\222\214\344\270\272\346\237\220\344\270\200\345\200\274\347\232\204\350\267\257\345\276\204/README.md"
index 3116d476bd1c4..0736d354d4db4 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23034. \344\272\214\345\217\211\346\240\221\344\270\255\345\222\214\344\270\272\346\237\220\344\270\200\345\200\274\347\232\204\350\267\257\345\276\204/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23034. \344\272\214\345\217\211\346\240\221\344\270\255\345\222\214\344\270\272\346\237\220\344\270\200\345\200\274\347\232\204\350\267\257\345\276\204/README.md"
@@ -69,6 +69,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -95,6 +97,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -136,6 +140,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -172,6 +178,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -202,6 +210,8 @@ func pathSum(root *TreeNode, target int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -241,6 +251,8 @@ function pathSum(root: TreeNode | null, target: number): number[][] {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -290,6 +302,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -325,6 +339,8 @@ var pathSum = function (root, target) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
@@ -374,6 +390,8 @@ public class Solution {
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23035. \345\244\215\346\235\202\351\223\276\350\241\250\347\232\204\345\244\215\345\210\266/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23035. \345\244\215\346\235\202\351\223\276\350\241\250\347\232\204\345\244\215\345\210\266/README.md"
index e5c1013dcf009..9f0560bf463b7 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23035. \345\244\215\346\235\202\351\223\276\350\241\250\347\232\204\345\244\215\345\210\266/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23035. \345\244\215\346\235\202\351\223\276\350\241\250\347\232\204\345\244\215\345\210\266/README.md"
@@ -79,6 +79,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
"""
# Definition for a Node.
@@ -109,6 +111,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/*
// Definition for a Node.
@@ -144,6 +148,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/*
// Definition for a Node.
@@ -181,6 +187,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a Node.
@@ -209,6 +217,8 @@ func copyRandomList(head *Node) *Node {
}
```
+#### JavaScript
+
```js
/**
* // Definition for a Node.
@@ -241,6 +251,8 @@ var copyRandomList = function (head) {
};
```
+#### C#
+
```cs
/*
// Definition for a Node.
@@ -295,6 +307,8 @@ public class Solution {
+#### Python3
+
```python
"""
# Definition for a Node.
@@ -332,6 +346,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/*
// Definition for a Node.
@@ -375,6 +391,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/*
// Definition for a Node.
@@ -421,6 +439,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a Node.
@@ -457,6 +477,8 @@ func copyRandomList(head *Node) *Node {
}
```
+#### JavaScript
+
```js
/**
* // Definition for a Node.
@@ -497,6 +519,8 @@ var copyRandomList = function (head) {
};
```
+#### C#
+
```cs
/*
// Definition for a Node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23036. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\216\345\217\214\345\220\221\351\223\276\350\241\250/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23036. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\216\345\217\214\345\220\221\351\223\276\350\241\250/README.md"
index 1fda83f158a89..181e2fc01e3d5 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23036. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\216\345\217\214\345\220\221\351\223\276\350\241\250/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23036. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\216\345\217\214\345\220\221\351\223\276\350\241\250/README.md"
@@ -58,6 +58,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
"""
# Definition for a Node.
@@ -93,6 +95,8 @@ class Solution:
return head
```
+#### Java
+
```java
/*
// Definition for a Node.
@@ -145,6 +149,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/*
// Definition for a Node.
@@ -200,6 +206,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a Node.
@@ -237,6 +245,8 @@ func treeToDoublyList(root *Node) *Node {
}
```
+#### JavaScript
+
```js
/**
* // Definition for a Node.
@@ -277,6 +287,8 @@ var treeToDoublyList = function (root) {
};
```
+#### C#
+
```cs
/*
// Definition for a Node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23037. \345\272\217\345\210\227\345\214\226\344\272\214\345\217\211\346\240\221/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23037. \345\272\217\345\210\227\345\214\226\344\272\214\345\217\211\346\240\221/README.md"
index 7ce89c9c994ee..f92093504146b 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23037. \345\272\217\345\210\227\345\214\226\344\272\214\345\217\211\346\240\221/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23037. \345\272\217\345\210\227\345\214\226\344\272\214\345\217\211\346\240\221/README.md"
@@ -47,6 +47,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode(object):
@@ -107,6 +109,8 @@ class Codec:
# codec.deserialize(codec.serialize(root))
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -172,6 +176,8 @@ public class Codec {
// codec.deserialize(codec.serialize(root));
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -239,6 +245,8 @@ public:
// codec.deserialize(codec.serialize(root));
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -313,6 +321,8 @@ func (this *Codec) deserialize(data string) *TreeNode {
*/
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -378,6 +388,8 @@ var deserialize = function (data) {
*/
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
@@ -446,6 +458,8 @@ public class Codec {
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -499,6 +513,8 @@ public:
// codec.deserialize(codec.serialize(root));
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -564,6 +580,8 @@ var deserialize = function (data) {
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23038. \345\255\227\347\254\246\344\270\262\347\232\204\346\216\222\345\210\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23038. \345\255\227\347\254\246\344\270\262\347\232\204\346\216\222\345\210\227/README.md"
index ab09bfdb67a17..99dca7b2cf85d 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23038. \345\255\227\347\254\246\344\270\262\347\232\204\346\216\222\345\210\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23038. \345\255\227\347\254\246\344\270\262\347\232\204\346\216\222\345\210\227/README.md"
@@ -55,6 +55,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def permutation(self, s: str) -> List[str]:
@@ -76,6 +78,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List ans = new ArrayList<>();
@@ -110,6 +114,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
func permutation(s string) (ans []string) {
cs := []byte(s)
@@ -160,6 +168,8 @@ func permutation(s string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function permutation(s: string): string[] {
const n = s.length;
@@ -182,6 +192,8 @@ function permutation(s: string): string[] {
}
```
+#### Rust
+
```rust
use std::collections::HashSet;
impl Solution {
@@ -210,6 +222,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -239,6 +253,8 @@ var permutation = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
private char[] cs;
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23039. \346\225\260\347\273\204\344\270\255\345\207\272\347\216\260\346\254\241\346\225\260\350\266\205\350\277\207\344\270\200\345\215\212\347\232\204\346\225\260\345\255\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23039. \346\225\260\347\273\204\344\270\255\345\207\272\347\216\260\346\254\241\346\225\260\350\266\205\350\277\207\344\270\200\345\215\212\347\232\204\346\225\260\345\255\227/README.md"
index 07c9b0ad8ce4d..dcdb05749243a 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23039. \346\225\260\347\273\204\344\270\255\345\207\272\347\216\260\346\254\241\346\225\260\350\266\205\350\277\207\344\270\200\345\215\212\347\232\204\346\225\260\345\255\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23039. \346\225\260\347\273\204\344\270\255\345\207\272\347\216\260\346\254\241\346\225\260\350\266\205\350\277\207\344\270\200\345\215\212\347\232\204\346\225\260\345\255\227/README.md"
@@ -59,6 +59,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def majorityElement(self, nums: List[int]) -> int:
@@ -71,6 +73,8 @@ class Solution:
return m
```
+#### Java
+
```java
class Solution {
public int majorityElement(int[] nums) {
@@ -88,6 +92,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -105,6 +111,8 @@ public:
};
```
+#### Go
+
```go
func majorityElement(nums []int) int {
cnt, m := 0, 0
@@ -123,6 +131,8 @@ func majorityElement(nums []int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn majority_element(nums: Vec) -> i32 {
@@ -141,6 +151,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -161,6 +173,8 @@ var majorityElement = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int MajorityElement(int[] nums) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23040. \346\234\200\345\260\217\347\232\204k\344\270\252\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23040. \346\234\200\345\260\217\347\232\204k\344\270\252\346\225\260/README.md"
index 44e303b0cf788..b5a7a183bb539 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23040. \346\234\200\345\260\217\347\232\204k\344\270\252\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23040. \346\234\200\345\260\217\347\232\204k\344\270\252\346\225\260/README.md"
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def getLeastNumbers(self, arr: List[int], k: int) -> List[int]:
@@ -57,6 +59,8 @@ class Solution:
return arr[:k]
```
+#### Java
+
```java
class Solution {
public int[] getLeastNumbers(int[] arr, int k) {
@@ -70,6 +74,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -80,6 +86,8 @@ public:
};
```
+#### Go
+
```go
func getLeastNumbers(arr []int, k int) []int {
sort.Ints(arr)
@@ -87,6 +95,8 @@ func getLeastNumbers(arr []int, k int) []int {
}
```
+#### TypeScript
+
```ts
function getLeastNumbers(arr: number[], k: number): number[] {
let start = 0;
@@ -114,6 +124,8 @@ function getLeastNumbers(arr: number[], k: number): number[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn get_least_numbers(mut arr: Vec, k: i32) -> Vec {
@@ -142,6 +154,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} arr
@@ -183,6 +197,8 @@ var getLeastNumbers = function (arr, k) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] GetLeastNumbers(int[] arr, int k) {
@@ -208,6 +224,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def getLeastNumbers(self, arr: List[int], k: int) -> List[int]:
@@ -219,6 +237,8 @@ class Solution:
return [-x for x in h]
```
+#### Java
+
```java
class Solution {
public int[] getLeastNumbers(int[] arr, int k) {
@@ -238,6 +258,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -259,6 +281,8 @@ public:
};
```
+#### Go
+
```go
func getLeastNumbers(arr []int, k int) (ans []int) {
q := hp{}
@@ -302,6 +326,8 @@ func (h *hp) pop() int { return heap.Pop(h).(int) }
+#### Python3
+
```python
class Solution:
def getLeastNumbers(self, arr: List[int], k: int) -> List[int]:
@@ -324,6 +350,8 @@ class Solution:
return arr if k == n else quick_sort(0, n - 1)
```
+#### Java
+
```java
class Solution {
private int[] arr;
@@ -365,6 +393,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -395,6 +425,8 @@ public:
};
```
+#### Go
+
```go
func getLeastNumbers(arr []int, k int) []int {
n := len(arr)
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/README.md"
index cd8182c44f7e5..6ae0884ee404b 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23041. \346\225\260\346\215\256\346\265\201\344\270\255\347\232\204\344\270\255\344\275\215\346\225\260/README.md"
@@ -70,6 +70,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class MedianFinder:
def __init__(self):
@@ -97,6 +99,8 @@ class MedianFinder:
# param_2 = obj.findMedian()
```
+#### Java
+
```java
class MedianFinder {
private PriorityQueue q1 = new PriorityQueue<>();
@@ -132,6 +136,8 @@ class MedianFinder {
*/
```
+#### C++
+
```cpp
class MedianFinder {
public:
@@ -171,6 +177,8 @@ private:
*/
```
+#### Go
+
```go
type MedianFinder struct {
q1, q2 hp
@@ -217,6 +225,8 @@ func (h *hp) Pop() any {
*/
```
+#### TypeScript
+
```ts
class MedianFinder {
private nums: number[];
@@ -258,6 +268,8 @@ class MedianFinder {
*/
```
+#### Rust
+
```rust
struct MedianFinder {
nums: Vec,
@@ -302,6 +314,8 @@ impl MedianFinder {
*/
```
+#### JavaScript
+
```js
/**
* initialize your data structure here.
@@ -337,6 +351,8 @@ MedianFinder.prototype.findMedian = function () {
};
```
+#### C#
+
```cs
public class MedianFinder {
private List nums;
@@ -406,6 +422,8 @@ public class MedianFinder {
+#### Python3
+
```python
from sortedcontainers import SortedList
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23042. \350\277\236\347\273\255\345\255\220\346\225\260\347\273\204\347\232\204\346\234\200\345\244\247\345\222\214/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23042. \350\277\236\347\273\255\345\255\220\346\225\260\347\273\204\347\232\204\346\234\200\345\244\247\345\222\214/README.md"
index e954994e53d7b..369dc1ba61592 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23042. \350\277\236\347\273\255\345\255\220\346\225\260\347\273\204\347\232\204\346\234\200\345\244\247\345\222\214/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23042. \350\277\236\347\273\255\345\255\220\346\225\260\347\273\204\347\232\204\346\234\200\345\244\247\345\222\214/README.md"
@@ -69,6 +69,8 @@ $$
+#### Python3
+
```python
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
@@ -79,6 +81,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int maxSubArray(int[] nums) {
@@ -93,6 +97,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -108,6 +114,8 @@ public:
};
```
+#### Go
+
```go
func maxSubArray(nums []int) int {
ans, f := -1000000000, 0
@@ -119,6 +127,8 @@ func maxSubArray(nums []int) int {
}
```
+#### TypeScript
+
```ts
function maxSubArray(nums: number[]): number {
let res = nums[0];
@@ -130,6 +140,8 @@ function maxSubArray(nums: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn max_sub_array(mut nums: Vec) -> i32 {
@@ -143,6 +155,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -159,6 +173,8 @@ var maxSubArray = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int MaxSubArray(int[] nums) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23043. 1\357\275\236n\346\225\264\346\225\260\344\270\2551\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23043. 1\357\275\236n\346\225\264\346\225\260\344\270\2551\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260/README.md"
index 8fd85c8fd5679..269738e9bd030 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23043. 1\357\275\236n\346\225\264\346\225\260\344\270\2551\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23043. 1\357\275\236n\346\225\264\346\225\260\344\270\2551\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260/README.md"
@@ -87,6 +87,8 @@ $$
+#### Python3
+
```python
class Solution:
def countDigitOne(self, n: int) -> int:
@@ -107,6 +109,8 @@ class Solution:
return dfs(len(a) - 1, 0, True)
```
+#### Java
+
```java
class Solution {
private int[] a = new int[12];
@@ -137,6 +141,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -167,6 +173,8 @@ public:
};
```
+#### Go
+
```go
func countDigitOne(n int) int {
a := [12]int{}
@@ -208,6 +216,8 @@ func countDigitOne(n int) int {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -236,6 +246,8 @@ var countDigitOne = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int CountDigitOne(int n) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23044. \346\225\260\345\255\227\345\272\217\345\210\227\344\270\255\346\237\220\344\270\200\344\275\215\347\232\204\346\225\260\345\255\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23044. \346\225\260\345\255\227\345\272\217\345\210\227\344\270\255\346\237\220\344\270\200\344\275\215\347\232\204\346\225\260\345\255\227/README.md"
index f93a9779f7a75..64ddca1e68cd6 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23044. \346\225\260\345\255\227\345\272\217\345\210\227\344\270\255\346\237\220\344\270\200\344\275\215\347\232\204\346\225\260\345\255\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23044. \346\225\260\345\255\227\345\272\217\345\210\227\344\270\255\346\237\220\344\270\200\344\275\215\347\232\204\346\225\260\345\255\227/README.md"
@@ -59,6 +59,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def findNthDigit(self, n: int) -> int:
@@ -72,6 +74,8 @@ class Solution:
return int(str(num)[idx])
```
+#### Java
+
```java
class Solution {
public int findNthDigit(int n) {
@@ -88,6 +92,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -105,6 +111,8 @@ public:
};
```
+#### Go
+
```go
func findNthDigit(n int) int {
k, cnt := 1, 9
@@ -119,6 +127,8 @@ func findNthDigit(n int) int {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -138,6 +148,8 @@ var findNthDigit = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int FindNthDigit(int n) {
@@ -164,6 +176,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def findNthDigit(self, n: int) -> int:
@@ -179,6 +193,8 @@ class Solution:
return int(str(x)[n % k])
```
+#### Java
+
```java
class Solution {
public int findNthDigit(int n) {
@@ -198,6 +214,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -218,6 +236,8 @@ public:
};
```
+#### Go
+
```go
func findNthDigit(n int) int {
if n < 10 {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23045. \346\212\212\346\225\260\347\273\204\346\216\222\346\210\220\346\234\200\345\260\217\347\232\204\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23045. \346\212\212\346\225\260\347\273\204\346\216\222\346\210\220\346\234\200\345\260\217\347\232\204\346\225\260/README.md"
index 58462ad7a60b5..fab74aa17bb60 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23045. \346\212\212\346\225\260\347\273\204\346\216\222\346\210\220\346\234\200\345\260\217\347\232\204\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23045. \346\212\212\346\225\260\347\273\204\346\216\222\346\210\220\346\234\200\345\260\217\347\232\204\346\225\260/README.md"
@@ -55,6 +55,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def minNumber(self, nums: List[int]) -> str:
@@ -67,6 +69,8 @@ class Solution:
return "".join(ans)
```
+#### Java
+
```java
class Solution {
public String minNumber(int[] nums) {
@@ -79,6 +83,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -99,6 +105,8 @@ public:
};
```
+#### Go
+
```go
func minNumber(nums []int) string {
arr := []string{}
@@ -110,12 +118,16 @@ func minNumber(nums []int) string {
}
```
+#### TypeScript
+
```ts
function minNumber(nums: number[]): string {
return nums.sort((a, b) => Number(`${a}${b}`) - Number(`${b}${a}`)).join('');
}
```
+#### Rust
+
```rust
impl Solution {
pub fn min_number(mut nums: Vec) -> String {
@@ -127,6 +139,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -142,6 +156,8 @@ var minNumber = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public string MinNumber(int[] nums) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23046. \346\212\212\346\225\260\345\255\227\347\277\273\350\257\221\346\210\220\345\255\227\347\254\246\344\270\262/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23046. \346\212\212\346\225\260\345\255\227\347\277\273\350\257\221\346\210\220\345\255\227\347\254\246\344\270\262/README.md"
index fdff487e0819b..bc4507327b5fb 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23046. \346\212\212\346\225\260\345\255\227\347\277\273\350\257\221\346\210\220\345\255\227\347\254\246\344\270\262/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23046. \346\212\212\346\225\260\345\255\227\347\277\273\350\257\221\346\210\220\345\255\227\347\254\246\344\270\262/README.md"
@@ -53,6 +53,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def translateNum(self, num: int) -> int:
@@ -70,6 +72,8 @@ class Solution:
return dfs(0)
```
+#### Java
+
```java
class Solution {
private int n;
@@ -99,6 +103,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -124,6 +130,8 @@ public:
};
```
+#### Go
+
```go
func translateNum(num int) int {
s := strconv.Itoa(num)
@@ -148,6 +156,8 @@ func translateNum(num int) int {
}
```
+#### TypeScript
+
```ts
function translateNum(num: number): number {
const s = num.toString();
@@ -171,6 +181,8 @@ function translateNum(num: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn translate_num(num: i32) -> i32 {
@@ -190,6 +202,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} num
@@ -217,6 +231,8 @@ var translateNum = function (num) {
};
```
+#### C#
+
```cs
public class Solution {
public int TranslateNum(int num) {
@@ -256,6 +272,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def translateNum(self, num: int) -> int:
@@ -270,6 +288,8 @@ class Solution:
return b
```
+#### Java
+
```java
class Solution {
public int translateNum(int num) {
@@ -289,6 +309,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -309,6 +331,8 @@ public:
};
```
+#### Go
+
```go
func translateNum(num int) int {
s := strconv.Itoa(num)
@@ -325,6 +349,8 @@ func translateNum(num int) int {
}
```
+#### TypeScript
+
```ts
function translateNum(num: number): number {
const s = num.toString();
@@ -343,6 +369,8 @@ function translateNum(num: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(s: &String, i: usize, res: &mut i32) {
@@ -366,6 +394,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} num
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23047. \347\244\274\347\211\251\347\232\204\346\234\200\345\244\247\344\273\267\345\200\274/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23047. \347\244\274\347\211\251\347\232\204\346\234\200\345\244\247\344\273\267\345\200\274/README.md"
index fa063be79f863..c0fa9ad135a9f 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23047. \347\244\274\347\211\251\347\232\204\346\234\200\345\244\247\344\273\267\345\200\274/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23047. \347\244\274\347\211\251\347\232\204\346\234\200\345\244\247\344\273\267\345\200\274/README.md"
@@ -58,6 +58,8 @@ $$
+#### Python3
+
```python
class Solution:
def maxValue(self, grid: List[List[int]]) -> int:
@@ -69,6 +71,8 @@ class Solution:
return f[m][n]
```
+#### Java
+
```java
class Solution {
public int maxValue(int[][] grid) {
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -100,6 +106,8 @@ public:
};
```
+#### Go
+
```go
func maxValue(grid [][]int) int {
m, n := len(grid), len(grid[0])
@@ -116,6 +124,8 @@ func maxValue(grid [][]int) int {
}
```
+#### TypeScript
+
```ts
function maxValue(grid: number[][]): number {
const m = grid.length;
@@ -130,6 +140,8 @@ function maxValue(grid: number[][]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn max_value(mut grid: Vec>) -> i32 {
@@ -151,6 +163,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} grid
@@ -169,6 +183,8 @@ var maxValue = function (grid) {
};
```
+#### C#
+
```cs
public class Solution {
public int MaxValue(int[][] grid) {
@@ -194,6 +210,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def maxValue(self, grid: List[List[int]]) -> int:
@@ -205,6 +223,8 @@ class Solution:
return f[m & 1][n]
```
+#### Java
+
```java
class Solution {
public int maxValue(int[][] grid) {
@@ -220,6 +240,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -236,6 +258,8 @@ public:
};
```
+#### Go
+
```go
func maxValue(grid [][]int) int {
m, n := len(grid), len(grid[0])
@@ -252,6 +276,8 @@ func maxValue(grid [][]int) int {
}
```
+#### TypeScript
+
```ts
function maxValue(grid: number[][]): number {
const m = grid.length;
@@ -266,6 +292,8 @@ function maxValue(grid: number[][]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[][]} grid
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23048. \346\234\200\351\225\277\344\270\215\345\220\253\351\207\215\345\244\215\345\255\227\347\254\246\347\232\204\345\255\220\345\255\227\347\254\246\344\270\262/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23048. \346\234\200\351\225\277\344\270\215\345\220\253\351\207\215\345\244\215\345\255\227\347\254\246\347\232\204\345\255\220\345\255\227\347\254\246\344\270\262/README.md"
index 2533d516fae47..02c373e77e5ee 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23048. \346\234\200\351\225\277\344\270\215\345\220\253\351\207\215\345\244\215\345\255\227\347\254\246\347\232\204\345\255\220\345\255\227\347\254\246\344\270\262/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23048. \346\234\200\351\225\277\344\270\215\345\220\253\351\207\215\345\244\215\345\255\227\347\254\246\347\232\204\345\255\220\345\255\227\347\254\246\344\270\262/README.md"
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
@@ -80,6 +82,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int lengthOfLongestSubstring(String s) {
@@ -97,6 +101,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -115,6 +121,8 @@ public:
};
```
+#### Go
+
```go
func lengthOfLongestSubstring(s string) (ans int) {
vis := map[byte]bool{}
@@ -131,6 +139,8 @@ func lengthOfLongestSubstring(s string) (ans int) {
}
```
+#### TypeScript
+
```ts
function lengthOfLongestSubstring(s: string): number {
let ans = 0;
@@ -146,6 +156,8 @@ function lengthOfLongestSubstring(s: string): number {
}
```
+#### Rust
+
```rust
use std::collections::HashSet;
impl Solution {
@@ -168,6 +180,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -187,6 +201,8 @@ var lengthOfLongestSubstring = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public int LengthOfLongestSubstring(string s) {
@@ -214,6 +230,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
@@ -228,6 +246,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int lengthOfLongestSubstring(String s) {
@@ -247,6 +267,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -266,6 +288,8 @@ public:
};
```
+#### Go
+
```go
func lengthOfLongestSubstring(s string) (ans int) {
ss := make([]bool, 128)
@@ -282,6 +306,8 @@ func lengthOfLongestSubstring(s string) (ans int) {
}
```
+#### TypeScript
+
```ts
function lengthOfLongestSubstring(s: string): number {
let ans = 0;
@@ -298,6 +324,8 @@ function lengthOfLongestSubstring(s: string): number {
}
```
+#### Rust
+
```rust
use std::collections::HashMap;
impl Solution {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23049. \344\270\221\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23049. \344\270\221\346\225\260/README.md"
index acba587cfe504..935a6b06b2899 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23049. \344\270\221\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23049. \344\270\221\346\225\260/README.md"
@@ -45,6 +45,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def nthUglyNumber(self, n: int) -> int:
@@ -61,6 +63,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int nthUglyNumber(int n) {
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -109,6 +115,8 @@ public:
};
```
+#### Go
+
```go
func nthUglyNumber(n int) int {
h := IntHeap([]int{1})
@@ -146,6 +154,8 @@ func (h *IntHeap) Pop() any {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn nth_ugly_number(n: i32) -> i32 {
@@ -175,6 +185,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -199,6 +211,8 @@ var nthUglyNumber = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int NthUglyNumber(int n) {
@@ -243,6 +257,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def nthUglyNumber(self, n: int) -> int:
@@ -260,6 +276,8 @@ class Solution:
return dp[-1]
```
+#### Java
+
```java
class Solution {
public int nthUglyNumber(int n) {
@@ -278,6 +296,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -297,6 +317,8 @@ public:
};
```
+#### Go
+
```go
func nthUglyNumber(n int) int {
dp := make([]int, n)
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23050. \347\254\254\344\270\200\344\270\252\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\345\255\227\347\254\246/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23050. \347\254\254\344\270\200\344\270\252\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\345\255\227\347\254\246/README.md"
index d99097dc4ec5b..78cf97b3cc117 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23050. \347\254\254\344\270\200\344\270\252\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\345\255\227\347\254\246/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23050. \347\254\254\344\270\200\344\270\252\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\345\255\227\347\254\246/README.md"
@@ -48,6 +48,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def firstUniqChar(self, s: str) -> str:
@@ -58,6 +60,8 @@ class Solution:
return " "
```
+#### Java
+
```java
class Solution {
public char firstUniqChar(String s) {
@@ -76,6 +80,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -94,6 +100,8 @@ public:
};
```
+#### Go
+
```go
func firstUniqChar(s string) byte {
cnt := [26]int{}
@@ -109,6 +117,8 @@ func firstUniqChar(s string) byte {
}
```
+#### TypeScript
+
```ts
function firstUniqChar(s: string): string {
const map = new Map();
@@ -124,6 +134,8 @@ function firstUniqChar(s: string): string {
}
```
+#### Rust
+
```rust
use std::collections::HashMap;
impl Solution {
@@ -142,6 +154,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -161,6 +175,8 @@ var firstUniqChar = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public char FirstUniqChar(string s) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23051. \346\225\260\347\273\204\344\270\255\347\232\204\351\200\206\345\272\217\345\257\271/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23051. \346\225\260\347\273\204\344\270\255\347\232\204\351\200\206\345\272\217\345\257\271/README.md"
index 908350aa66c87..12f5176d38895 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23051. \346\225\260\347\273\204\344\270\255\347\232\204\351\200\206\345\272\217\345\257\271/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23051. \346\225\260\347\273\204\344\270\255\347\232\204\351\200\206\345\272\217\345\257\271/README.md"
@@ -41,6 +41,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def reversePairs(self, nums: List[int]) -> int:
@@ -67,6 +69,8 @@ class Solution:
return merge_sort(0, len(nums) - 1)
```
+#### Java
+
```java
class Solution {
private int[] nums;
@@ -108,6 +112,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -148,6 +154,8 @@ public:
};
```
+#### Go
+
```go
func reversePairs(nums []int) int {
n := len(nums)
@@ -185,6 +193,8 @@ func reversePairs(nums []int) int {
}
```
+#### TypeScript
+
```ts
function reversePairs(nums: number[]): number {
const mergeSort = (l: number, r: number): number => {
@@ -219,6 +229,8 @@ function reversePairs(nums: number[]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -257,6 +269,8 @@ var reversePairs = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
private int[] nums;
@@ -321,6 +335,8 @@ public class Solution {
+#### Python3
+
```python
class BinaryIndexedTree:
def __init__(self, n):
@@ -353,6 +369,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int reversePairs(int[] nums) {
@@ -403,6 +421,8 @@ class BinaryIndexedTree {
}
```
+#### C++
+
```cpp
class BinaryIndexedTree {
public:
@@ -448,6 +468,8 @@ public:
};
```
+#### Go
+
```go
func reversePairs(nums []int) (ans int) {
s := map[int]bool{}
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23052. \344\270\244\344\270\252\351\223\276\350\241\250\347\232\204\347\254\254\344\270\200\344\270\252\345\205\254\345\205\261\350\212\202\347\202\271/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23052. \344\270\244\344\270\252\351\223\276\350\241\250\347\232\204\347\254\254\344\270\200\344\270\252\345\205\254\345\205\261\350\212\202\347\202\271/README.md"
index 6265c3619fc0f..00166de622f77 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23052. \344\270\244\344\270\252\351\223\276\350\241\250\347\232\204\347\254\254\344\270\200\344\270\252\345\205\254\345\205\261\350\212\202\347\202\271/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23052. \344\270\244\344\270\252\351\223\276\350\241\250\347\232\204\347\254\254\344\270\200\344\270\252\345\205\254\345\205\261\350\212\202\347\202\271/README.md"
@@ -80,6 +80,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -97,6 +99,8 @@ class Solution:
return a
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -121,6 +125,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -143,6 +149,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -169,6 +177,8 @@ func getIntersectionNode(headA, headB *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -193,6 +203,8 @@ function getIntersectionNode(headA: ListNode | null, headB: ListNode | null): Li
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -218,6 +230,8 @@ var getIntersectionNode = function (headA, headB) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23053 - I. \345\234\250\346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\346\237\245\346\211\276\346\225\260\345\255\227 I/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23053 - I. \345\234\250\346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\346\237\245\346\211\276\346\225\260\345\255\227 I/README.md"
index a7b57407e527a..23ab5c1b6bdbb 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23053 - I. \345\234\250\346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\346\237\245\346\211\276\346\225\260\345\255\227 I/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23053 - I. \345\234\250\346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\346\237\245\346\211\276\346\225\260\345\255\227 I/README.md"
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def search(self, nums: List[int], target: int) -> int:
@@ -64,6 +66,8 @@ class Solution:
return r - l
```
+#### Java
+
```java
class Solution {
public int search(int[] nums, int target) {
@@ -87,6 +91,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -98,6 +104,8 @@ public:
};
```
+#### Go
+
```go
func search(nums []int, target int) int {
l := sort.Search(len(nums), func(i int) bool { return nums[i] >= target })
@@ -106,6 +114,8 @@ func search(nums []int, target int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn search(nums: Vec, target: i32) -> i32 {
@@ -127,6 +137,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -153,6 +165,8 @@ var search = function (nums, target) {
};
```
+#### C#
+
```cs
public class Solution {
public int Search(int[] nums, int target) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23053 - II. 0\357\275\236n-1\344\270\255\347\274\272\345\244\261\347\232\204\346\225\260\345\255\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23053 - II. 0\357\275\236n-1\344\270\255\347\274\272\345\244\261\347\232\204\346\225\260\345\255\227/README.md"
index 5ebd38d3bbebc..37d5ef58fb1ee 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23053 - II. 0\357\275\236n-1\344\270\255\347\274\272\345\244\261\347\232\204\346\225\260\345\255\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23053 - II. 0\357\275\236n-1\344\270\255\347\274\272\345\244\261\347\232\204\346\225\260\345\255\227/README.md"
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def missingNumber(self, nums: List[int]) -> int:
@@ -63,6 +65,8 @@ class Solution:
return l
```
+#### Java
+
```java
class Solution {
public int missingNumber(int[] nums) {
@@ -80,6 +84,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -98,6 +104,8 @@ public:
};
```
+#### Go
+
```go
func missingNumber(nums []int) int {
l, r := 0, len(nums)
@@ -113,6 +121,8 @@ func missingNumber(nums []int) int {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn missing_number(nums: Vec) -> i32 {
@@ -130,6 +140,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -150,6 +162,8 @@ var missingNumber = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int MissingNumber(int[] nums) {
@@ -177,6 +191,8 @@ public class Solution {
+#### Rust
+
```rust
impl Solution {
pub fn missing_number(nums: Vec) -> i32 {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23054. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\347\254\254k\345\244\247\350\212\202\347\202\271/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23054. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\347\254\254k\345\244\247\350\212\202\347\202\271/README.md"
index e4da69c063f08..c0cbd61793288 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23054. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\347\254\254k\345\244\247\350\212\202\347\202\271/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23054. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\347\254\254k\345\244\247\350\212\202\347\202\271/README.md"
@@ -64,6 +64,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -90,6 +92,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -123,6 +127,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -153,6 +159,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -180,6 +188,8 @@ func kthLargest(root *TreeNode, k int) (ans int) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -213,6 +223,8 @@ function kthLargest(root: TreeNode | null, k: number): number {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -252,6 +264,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -282,6 +296,8 @@ var kthLargest = function (root, k) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
@@ -325,6 +341,8 @@ public class Solution {
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23055 - I. \344\272\214\345\217\211\346\240\221\347\232\204\346\267\261\345\272\246/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23055 - I. \344\272\214\345\217\211\346\240\221\347\232\204\346\267\261\345\272\246/README.md"
index a5cc95766de74..280c8f2da197d 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23055 - I. \344\272\214\345\217\211\346\240\221\347\232\204\346\267\261\345\272\246/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23055 - I. \344\272\214\345\217\211\346\240\221\347\232\204\346\267\261\345\272\246/README.md"
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -66,6 +68,8 @@ class Solution:
return 1 + max(self.maxDepth(root.left), self.maxDepth(root.right))
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -86,6 +90,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -107,6 +113,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -128,6 +136,8 @@ func maxDepth(root *TreeNode) int {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -164,6 +174,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -184,6 +196,8 @@ var maxDepth = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
@@ -214,6 +228,8 @@ public class Solution {
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23055 - II. \345\271\263\350\241\241\344\272\214\345\217\211\346\240\221/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23055 - II. \345\271\263\350\241\241\344\272\214\345\217\211\346\240\221/README.md"
index d72ae100caa6f..656700fec7dba 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23055 - II. \345\271\263\350\241\241\344\272\214\345\217\211\346\240\221/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23055 - II. \345\271\263\350\241\241\344\272\214\345\217\211\346\240\221/README.md"
@@ -80,6 +80,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -102,6 +104,8 @@ class Solution:
return dfs(root) != -1
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -131,6 +135,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -160,6 +166,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -192,6 +200,8 @@ func abs(x int) int {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -238,6 +248,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -266,6 +278,8 @@ var isBalanced = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
@@ -305,6 +319,8 @@ public class Solution {
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23056 - I. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23056 - I. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260/README.md"
index 2e32982b505c5..ad48541cad39b 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23056 - I. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23056 - I. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260/README.md"
@@ -55,6 +55,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def singleNumbers(self, nums: List[int]) -> List[int]:
@@ -68,6 +70,8 @@ class Solution:
return [a, b]
```
+#### Java
+
```java
class Solution {
public int[] singleNumbers(int[] nums) {
@@ -88,6 +92,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -109,6 +115,8 @@ public:
};
```
+#### Go
+
```go
func singleNumbers(nums []int) []int {
xs := 0
@@ -127,6 +135,8 @@ func singleNumbers(nums []int) []int {
}
```
+#### TypeScript
+
```ts
function singleNumbers(nums: number[]): number[] {
let xs = 0;
@@ -145,6 +155,8 @@ function singleNumbers(nums: number[]): number[] {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -167,6 +179,8 @@ var singleNumbers = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] SingleNumbers(int[] nums) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23056 - II. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260 II/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23056 - II. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260 II/README.md"
index b5a637f8c07ee..4bc932c2cc16c 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23056 - II. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260 II/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23056 - II. \346\225\260\347\273\204\344\270\255\346\225\260\345\255\227\345\207\272\347\216\260\347\232\204\346\254\241\346\225\260 II/README.md"
@@ -52,6 +52,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def singleNumber(self, nums: List[int]) -> int:
@@ -63,6 +65,8 @@ class Solution:
return sum(1 << i for i in range(32) if cnt[i] % 3)
```
+#### Java
+
```java
class Solution {
public int singleNumber(int[] nums) {
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -106,6 +112,8 @@ public:
};
```
+#### Go
+
```go
func singleNumber(nums []int) (ans int) {
cnt := [32]int{}
@@ -124,6 +132,8 @@ func singleNumber(nums []int) (ans int) {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn single_number(nums: Vec) -> i32 {
@@ -143,6 +153,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -166,6 +178,8 @@ var singleNumber = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int SingleNumber(int[] nums) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23057 - II. \345\222\214\344\270\272s\347\232\204\350\277\236\347\273\255\346\255\243\346\225\260\345\272\217\345\210\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23057 - II. \345\222\214\344\270\272s\347\232\204\350\277\236\347\273\255\346\255\243\346\225\260\345\272\217\345\210\227/README.md"
index b7c524c9bc46e..7929eb5b73509 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23057 - II. \345\222\214\344\270\272s\347\232\204\350\277\236\347\273\255\346\255\243\346\225\260\345\272\217\345\210\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23057 - II. \345\222\214\344\270\272s\347\232\204\350\277\236\347\273\255\346\255\243\346\225\260\345\272\217\345\210\227/README.md"
@@ -58,6 +58,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def findContinuousSequence(self, target: int) -> List[List[int]]:
@@ -75,6 +77,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[][] findContinuousSequence(int target) {
@@ -100,6 +104,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -124,6 +130,8 @@ public:
};
```
+#### Go
+
```go
func findContinuousSequence(target int) (ans [][]int) {
l, r := 1, 2
@@ -146,6 +154,8 @@ func findContinuousSequence(target int) (ans [][]int) {
}
```
+#### JavaScript
+
```js
/**
* @param {number} target
@@ -174,6 +184,8 @@ var findContinuousSequence = function (target) {
};
```
+#### C#
+
```cs
public class Solution {
public int[][] FindContinuousSequence(int target) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23057. \345\222\214\344\270\272s\347\232\204\344\270\244\344\270\252\346\225\260\345\255\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23057. \345\222\214\344\270\272s\347\232\204\344\270\244\344\270\252\346\225\260\345\255\227/README.md"
index d482828d6661a..f12d498bd1af7 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23057. \345\222\214\344\270\272s\347\232\204\344\270\244\344\270\252\346\225\260\345\255\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23057. \345\222\214\344\270\272s\347\232\204\344\270\244\344\270\252\346\225\260\345\255\227/README.md"
@@ -47,6 +47,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
### **Python3**
+#### Python3
+
```python
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
@@ -62,6 +64,8 @@ class Solution:
### **Java**
+#### Java
+
```java
class Solution {
public int[] twoSum(int[] nums, int target) {
@@ -82,6 +86,8 @@ class Solution {
### **C++**
+#### C++
+
```cpp
class Solution {
public:
@@ -103,6 +109,8 @@ public:
### **Go**
+#### Go
+
```go
func twoSum(nums []int, target int) []int {
l, r := 0, len(nums)-1
@@ -121,6 +129,8 @@ func twoSum(nums []int, target int) []int {
### **JavaScript**
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -145,6 +155,8 @@ var twoSum = function (nums, target) {
### **TypeScript**
+#### TypeScript
+
```ts
function twoSum(nums: number[], target: number): number[] {
let l = 0;
@@ -162,6 +174,8 @@ function twoSum(nums: number[], target: number): number[] {
### **Rust**
+#### Rust
+
```rust
use std::cmp::Ordering;
@@ -188,6 +202,8 @@ impl Solution {
### **C#**
+#### C#
+
```cs
public class Solution {
public int[] TwoSum(int[] nums, int target) {
@@ -226,6 +242,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
@@ -239,6 +257,8 @@ class Solution:
l += 1
```
+#### Java
+
```java
class Solution {
public int[] twoSum(int[] nums, int target) {
@@ -257,6 +277,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -276,6 +298,8 @@ public:
};
```
+#### Go
+
```go
func twoSum(nums []int, target int) []int {
l, r := 0, len(nums)-1
@@ -292,6 +316,8 @@ func twoSum(nums []int, target int) []int {
}
```
+#### TypeScript
+
```ts
function twoSum(nums: number[], target: number): number[] {
let l = 0;
@@ -307,6 +333,8 @@ function twoSum(nums: number[], target: number): number[] {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
@@ -331,6 +359,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -353,6 +383,8 @@ var twoSum = function (nums, target) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] TwoSum(int[] nums, int target) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23058 - I. \347\277\273\350\275\254\345\215\225\350\257\215\351\241\272\345\272\217/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23058 - I. \347\277\273\350\275\254\345\215\225\350\257\215\351\241\272\345\272\217/README.md"
index 6798538363544..74cba777d6b6d 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23058 - I. \347\277\273\350\275\254\345\215\225\350\257\215\351\241\272\345\272\217/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23058 - I. \347\277\273\350\275\254\345\215\225\350\257\215\351\241\272\345\272\217/README.md"
@@ -64,12 +64,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def reverseWords(self, s: str) -> str:
return " ".join(s.strip().split()[::-1])
```
+#### Java
+
```java
class Solution {
public String reverseWords(String s) {
@@ -85,6 +89,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -108,6 +114,8 @@ public:
};
```
+#### Go
+
```go
func reverseWords(s string) string {
s = strings.Trim(s, " ")
@@ -129,12 +137,16 @@ func reverseWords(s string) string {
}
```
+#### TypeScript
+
```ts
function reverseWords(s: string): string {
return s.trim().split(/\s+/).reverse().join(' ');
}
```
+#### Rust
+
```rust
impl Solution {
pub fn reverse_words(mut s: String) -> String {
@@ -149,6 +161,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -163,6 +177,8 @@ var reverseWords = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public string ReverseWords(string s) {
@@ -195,6 +211,8 @@ public class Solution {
+#### TypeScript
+
```ts
function reverseWords(s: string): string {
s = s.trim();
@@ -215,6 +233,8 @@ function reverseWords(s: string): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn reverse_words(s: String) -> String {
@@ -237,6 +257,8 @@ impl Solution {
+#### Rust
+
```rust
impl Solution {
pub fn reverse_words(s: String) -> String {
@@ -255,6 +277,8 @@ impl Solution {
+#### Rust
+
```rust
impl Solution {
pub fn reverse_words(mut s: String) -> String {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23058 - II. \345\267\246\346\227\213\350\275\254\345\255\227\347\254\246\344\270\262/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23058 - II. \345\267\246\346\227\213\350\275\254\345\255\227\347\254\246\344\270\262/README.md"
index 43b44d48d43f7..763d8821f9130 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23058 - II. \345\267\246\346\227\213\350\275\254\345\255\227\347\254\246\344\270\262/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23058 - II. \345\267\246\346\227\213\350\275\254\345\255\227\347\254\246\344\270\262/README.md"
@@ -50,12 +50,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def reverseLeftWords(self, s: str, n: int) -> str:
return s[n:] + s[:n]
```
+#### Java
+
```java
class Solution {
public String reverseLeftWords(String s, int n) {
@@ -64,6 +68,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -73,12 +79,16 @@ public:
};
```
+#### Go
+
```go
func reverseLeftWords(s string, n int) string {
return s[n:] + s[:n]
}
```
+#### Rust
+
```rust
impl Solution {
pub fn reverse_left_words(s: String, n: i32) -> String {
@@ -88,6 +98,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -99,6 +111,8 @@ var reverseLeftWords = function (s, n) {
};
```
+#### C#
+
```cs
public class Solution {
public string ReverseLeftWords(string s, int n) {
@@ -117,6 +131,8 @@ public class Solution {
+#### C++
+
```cpp
class Solution {
public:
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23059 - I. \346\273\221\345\212\250\347\252\227\345\217\243\347\232\204\346\234\200\345\244\247\345\200\274/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23059 - I. \346\273\221\345\212\250\347\252\227\345\217\243\347\232\204\346\234\200\345\244\247\345\200\274/README.md"
index 4d91e0a77eb3d..dc8c30bb4b3ac 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23059 - I. \346\273\221\345\212\250\347\252\227\345\217\243\347\232\204\346\234\200\345\244\247\345\200\274/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23059 - I. \346\273\221\345\212\250\347\252\227\345\217\243\347\232\204\346\234\200\345\244\247\345\200\274/README.md"
@@ -62,6 +62,8 @@ for i in range(n):
+#### Python3
+
```python
class Solution:
def maxSlidingWindow(self, nums: List[int], k: int) -> List[int]:
@@ -78,6 +80,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] maxSlidingWindow(int[] nums, int k) {
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -125,6 +131,8 @@ public:
};
```
+#### Go
+
```go
func maxSlidingWindow(nums []int, k int) (ans []int) {
q := []int{}
@@ -144,6 +152,8 @@ func maxSlidingWindow(nums []int, k int) (ans []int) {
}
```
+#### TypeScript
+
```ts
function maxSlidingWindow(nums: number[], k: number): number[] {
const q: number[] = [];
@@ -165,6 +175,8 @@ function maxSlidingWindow(nums: number[], k: number): number[] {
}
```
+#### Rust
+
```rust
use std::collections::VecDeque;
impl Solution {
@@ -190,6 +202,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -216,6 +230,8 @@ var maxSlidingWindow = function (nums, k) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] MaxSlidingWindow(int[] nums, int k) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23059 - II. \351\230\237\345\210\227\347\232\204\346\234\200\345\244\247\345\200\274/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23059 - II. \351\230\237\345\210\227\347\232\204\346\234\200\345\244\247\345\200\274/README.md"
index d849057232873..836c6955dc90f 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23059 - II. \351\230\237\345\210\227\347\232\204\346\234\200\345\244\247\345\200\274/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23059 - II. \351\230\237\345\210\227\347\232\204\346\234\200\345\244\247\345\200\274/README.md"
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class MaxQueue:
def __init__(self):
@@ -92,6 +94,8 @@ class MaxQueue:
# param_3 = obj.pop_front()
```
+#### Java
+
```java
class MaxQueue {
private Deque q1 = new ArrayDeque<>();
@@ -133,6 +137,8 @@ class MaxQueue {
*/
```
+#### C++
+
```cpp
class MaxQueue {
public:
@@ -177,6 +183,8 @@ private:
*/
```
+#### Go
+
```go
type MaxQueue struct {
q1, q2 []int
@@ -222,6 +230,8 @@ func (this *MaxQueue) Pop_front() int {
*/
```
+#### TypeScript
+
```ts
class MaxQueue {
private queue: number[];
@@ -262,6 +272,8 @@ class MaxQueue {
*/
```
+#### Rust
+
```rust
use std::collections::VecDeque;
struct MaxQueue {
@@ -312,6 +324,8 @@ impl MaxQueue {
*/
```
+#### JavaScript
+
```js
var MaxQueue = function () {
this.q1 = [];
@@ -360,6 +374,8 @@ MaxQueue.prototype.pop_front = function () {
*/
```
+#### C#
+
```cs
public class MaxQueue {
LinkedList mvq;
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23060. n\344\270\252\351\252\260\345\255\220\347\232\204\347\202\271\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23060. n\344\270\252\351\252\260\345\255\220\347\232\204\347\202\271\346\225\260/README.md"
index cfad0b2272bc9..9d5b1d571b45e 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23060. n\344\270\252\351\252\260\345\255\220\347\232\204\347\202\271\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23060. n\344\270\252\351\252\260\345\255\220\347\232\204\347\202\271\346\225\260/README.md"
@@ -61,6 +61,8 @@ $$
+#### Python3
+
```python
class Solution:
def dicesProbability(self, n: int) -> List[float]:
@@ -76,6 +78,8 @@ class Solution:
return [f[n][i] / m for i in range(n, 6 * n + 1)]
```
+#### Java
+
```java
class Solution {
public double[] dicesProbability(int n) {
@@ -102,6 +106,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -130,6 +136,8 @@ public:
};
```
+#### Go
+
```go
func dicesProbability(n int) (ans []float64) {
f := make([][]int, n+1)
@@ -156,6 +164,8 @@ func dicesProbability(n int) (ans []float64) {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -184,6 +194,8 @@ var dicesProbability = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public double[] DicesProbability(int n) {
@@ -216,6 +228,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def dicesProbability(self, n: int) -> List[float]:
@@ -231,6 +245,8 @@ class Solution:
return [f[j] / m for j in range(n, 6 * n + 1)]
```
+#### Go
+
```go
func dicesProbability(n int) []float64 {
dp := make([]float64, 7)
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23061. \346\211\221\345\205\213\347\211\214\344\270\255\347\232\204\351\241\272\345\255\220/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23061. \346\211\221\345\205\213\347\211\214\344\270\255\347\232\204\351\241\272\345\255\220/README.md"
index c888621a4739c..3ff3d4efee8c2 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23061. \346\211\221\345\205\213\347\211\214\344\270\255\347\232\204\351\241\272\345\255\220/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23061. \346\211\221\345\205\213\347\211\214\344\270\255\347\232\204\351\241\272\345\255\220/README.md"
@@ -57,6 +57,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def isStraight(self, nums: List[int]) -> bool:
@@ -73,6 +75,8 @@ class Solution:
return mx - mi <= 4
```
+#### Java
+
```java
class Solution {
public boolean isStraight(int[] nums) {
@@ -94,6 +98,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -116,6 +122,8 @@ public:
};
```
+#### Go
+
```go
func isStraight(nums []int) bool {
vis := map[int]bool{}
@@ -135,6 +143,8 @@ func isStraight(nums []int) bool {
}
```
+#### TypeScript
+
```ts
function isStraight(nums: number[]): boolean {
nums.sort((a, b) => a - b);
@@ -150,6 +160,8 @@ function isStraight(nums: number[]): boolean {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_straight(mut nums: Vec) -> bool {
@@ -167,6 +179,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -191,6 +205,8 @@ var isStraight = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public bool IsStraight(int[] nums) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23062. \345\234\206\345\234\210\344\270\255\346\234\200\345\220\216\345\211\251\344\270\213\347\232\204\346\225\260\345\255\227/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23062. \345\234\206\345\234\210\344\270\255\346\234\200\345\220\216\345\211\251\344\270\213\347\232\204\346\225\260\345\255\227/README.md"
index d88ff0d0b7e10..0f0b6c9a4656e 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23062. \345\234\206\345\234\210\344\270\255\346\234\200\345\220\216\345\211\251\344\270\213\347\232\204\346\225\260\345\255\227/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23062. \345\234\206\345\234\210\344\270\255\346\234\200\345\220\216\345\211\251\344\270\213\347\232\204\346\225\260\345\255\227/README.md"
@@ -63,6 +63,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def lastRemaining(self, n: int, m: int) -> int:
@@ -75,6 +77,8 @@ class Solution:
return f(n, m)
```
+#### Java
+
```java
class Solution {
public int lastRemaining(int n, int m) {
@@ -91,6 +95,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -108,6 +114,8 @@ public:
};
```
+#### Go
+
```go
func lastRemaining(n int, m int) int {
var f func(n, m int) int
@@ -122,6 +130,8 @@ func lastRemaining(n int, m int) int {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -137,6 +147,8 @@ var lastRemaining = function (n, m) {
};
```
+#### C#
+
```cs
public class Solution {
public int LastRemaining(int n, int m) {
@@ -159,6 +171,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def lastRemaining(self, n: int, m: int) -> int:
@@ -168,6 +182,8 @@ class Solution:
return f
```
+#### Java
+
```java
class Solution {
public int lastRemaining(int n, int m) {
@@ -180,6 +196,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -193,6 +211,8 @@ public:
};
```
+#### Go
+
```go
func lastRemaining(n int, m int) int {
f := 0
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23063. \350\202\241\347\245\250\347\232\204\346\234\200\345\244\247\345\210\251\346\266\246/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23063. \350\202\241\347\245\250\347\232\204\346\234\200\345\244\247\345\210\251\346\266\246/README.md"
index bb75daf4b0794..548bf95dd890a 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23063. \350\202\241\347\245\250\347\232\204\346\234\200\345\244\247\345\210\251\346\266\246/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23063. \350\202\241\347\245\250\347\232\204\346\234\200\345\244\247\345\210\251\346\266\246/README.md"
@@ -54,6 +54,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def maxProfit(self, prices: List[int]) -> int:
@@ -64,6 +66,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int maxProfit(int[] prices) {
@@ -77,6 +81,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -91,6 +97,8 @@ public:
};
```
+#### Go
+
```go
func maxProfit(prices []int) (ans int) {
mi := 1 << 30
@@ -102,6 +110,8 @@ func maxProfit(prices []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function maxProfit(prices: number[]): number {
let res = 0;
@@ -114,6 +124,8 @@ function maxProfit(prices: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn max_profit(prices: Vec) -> i32 {
@@ -128,6 +140,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} prices
@@ -144,6 +158,8 @@ var maxProfit = function (prices) {
};
```
+#### C#
+
```cs
public class Solution {
public int MaxProfit(int[] prices) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23064. \346\261\2021+2+\342\200\246+n/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23064. \346\261\2021+2+\342\200\246+n/README.md"
index 3f2234cdaee10..abb3d16bae1f6 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23064. \346\261\2021+2+\342\200\246+n/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23064. \346\261\2021+2+\342\200\246+n/README.md"
@@ -46,12 +46,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def sumNums(self, n: int) -> int:
return n and (n + self.sumNums(n - 1))
```
+#### Java
+
```java
class Solution {
public int sumNums(int n) {
@@ -62,6 +66,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -72,6 +78,8 @@ public:
};
```
+#### Go
+
```go
func sumNums(n int) int {
s := 0
@@ -85,12 +93,16 @@ func sumNums(n int) int {
}
```
+#### TypeScript
+
```ts
var sumNums = function (n: number): number {
return n && n + sumNums(n - 1);
};
```
+#### Rust
+
```rust
impl Solution {
pub fn sum_nums(mut n: i32) -> i32 {
@@ -106,6 +118,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -116,6 +130,8 @@ var sumNums = function (n) {
};
```
+#### C#
+
```cs
public class Solution {
public int result;
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23065. \344\270\215\347\224\250\345\212\240\345\207\217\344\271\230\351\231\244\345\201\232\345\212\240\346\263\225/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23065. \344\270\215\347\224\250\345\212\240\345\207\217\344\271\230\351\231\244\345\201\232\345\212\240\346\263\225/README.md"
index ee61fa2967d22..8e5ac6922ce09 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23065. \344\270\215\347\224\250\345\212\240\345\207\217\344\271\230\351\231\244\345\201\232\345\212\240\346\263\225/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23065. \344\270\215\347\224\250\345\212\240\345\207\217\344\271\230\351\231\244\345\201\232\345\212\240\346\263\225/README.md"
@@ -60,6 +60,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def add(self, a: int, b: int) -> int:
@@ -70,6 +72,8 @@ class Solution:
return a if a < 0x80000000 else ~(a ^ 0xFFFFFFFF)
```
+#### Java
+
```java
class Solution {
public int add(int a, int b) {
@@ -83,6 +87,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -97,6 +103,8 @@ public:
};
```
+#### Go
+
```go
func add(a int, b int) int {
if b == 0 {
@@ -106,6 +114,8 @@ func add(a int, b int) int {
}
```
+#### TypeScript
+
```ts
function add(a: number, b: number): number {
while (b) {
@@ -117,6 +127,8 @@ function add(a: number, b: number): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number} a
@@ -131,6 +143,8 @@ var add = function (a, b) {
};
```
+#### C#
+
```cs
public class Solution {
public int Add(int a, int b) {
@@ -155,6 +169,8 @@ public class Solution {
+#### Java
+
```java
class Solution {
public int add(int a, int b) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23066. \346\236\204\345\273\272\344\271\230\347\247\257\346\225\260\347\273\204/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23066. \346\236\204\345\273\272\344\271\230\347\247\257\346\225\260\347\273\204/README.md"
index 622f376cfea52..57c7b1ca3c6b7 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23066. \346\236\204\345\273\272\344\271\230\347\247\257\346\225\260\347\273\204/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23066. \346\236\204\345\273\272\344\271\230\347\247\257\346\225\260\347\273\204/README.md"
@@ -51,6 +51,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def constructArr(self, a: List[int]) -> List[int]:
@@ -66,6 +68,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] constructArr(int[] a) {
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -103,6 +109,8 @@ public:
};
```
+#### Go
+
```go
func constructArr(a []int) []int {
n := len(a)
@@ -119,6 +127,8 @@ func constructArr(a []int) []int {
}
```
+#### TypeScript
+
```ts
function constructArr(a: number[]): number[] {
const n = a.length;
@@ -135,6 +145,8 @@ function constructArr(a: number[]): number[] {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} a
@@ -155,6 +167,8 @@ var constructArr = function (a) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] ConstructArr(int[] a) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23067. \346\212\212\345\255\227\347\254\246\344\270\262\350\275\254\346\215\242\346\210\220\346\225\264\346\225\260/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23067. \346\212\212\345\255\227\347\254\246\344\270\262\350\275\254\346\215\242\346\210\220\346\225\264\346\225\260/README.md"
index 0c29844fa3724..4688aa27dc263 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23067. \346\212\212\345\255\227\347\254\246\344\270\262\350\275\254\346\215\242\346\210\220\346\225\264\346\225\260/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23067. \346\212\212\345\255\227\347\254\246\344\270\262\350\275\254\346\215\242\346\210\220\346\225\264\346\225\260/README.md"
@@ -80,6 +80,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
class Solution:
def strToInt(self, str: str) -> int:
@@ -111,6 +113,8 @@ class Solution:
return sign * res
```
+#### Java
+
```java
class Solution {
public int strToInt(String str) {
@@ -139,6 +143,8 @@ class Solution {
}
```
+#### Go
+
```go
func strToInt(str string) int {
n, sign, i, x := len(str), 1, 0, 0
@@ -186,6 +192,8 @@ func strToInt(str string) int {
}
```
+#### JavaScript
+
```js
/**
* @param {string} str
@@ -213,6 +221,8 @@ var strToInt = function (str) {
};
```
+#### C#
+
```cs
public class Solution {
public int StrToInt(string str) {
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23068 - I. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23068 - I. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210/README.md"
index f25c5705aa7f1..b2c0307251537 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23068 - I. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23068 - I. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210/README.md"
@@ -60,6 +60,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -82,6 +84,8 @@ class Solution:
return root
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -107,6 +111,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -131,6 +137,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -152,6 +160,8 @@ func lowestCommonAncestor(root, p, q *TreeNode) *TreeNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -184,6 +194,8 @@ function lowestCommonAncestor(
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -232,6 +244,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -266,6 +280,8 @@ var lowestCommonAncestor = function (root, p, q) {
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -286,6 +302,8 @@ class Solution:
return root
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -309,6 +327,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -335,6 +355,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -358,6 +380,8 @@ func lowestCommonAncestor(root, p, q *TreeNode) *TreeNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
diff --git "a/lcof/\351\235\242\350\257\225\351\242\23068 - II. \344\272\214\345\217\211\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210/README.md" "b/lcof/\351\235\242\350\257\225\351\242\23068 - II. \344\272\214\345\217\211\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210/README.md"
index 6579fb8cd9115..826848ea79387 100644
--- "a/lcof/\351\235\242\350\257\225\351\242\23068 - II. \344\272\214\345\217\211\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210/README.md"
+++ "b/lcof/\351\235\242\350\257\225\351\242\23068 - II. \344\272\214\345\217\211\346\240\221\347\232\204\346\234\200\350\277\221\345\205\254\345\205\261\347\245\226\345\205\210/README.md"
@@ -72,6 +72,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof/%E9%9D%A2%E8%AF%95%E9
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -96,6 +98,8 @@ class Solution:
return root
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -153,6 +159,8 @@ public:
};
```
+#### Go
+
```go
func lowestCommonAncestor(root, p, q *TreeNode) *TreeNode {
if root == nil || root == p || root == q {
@@ -170,6 +178,8 @@ func lowestCommonAncestor(root, p, q *TreeNode) *TreeNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -207,6 +217,8 @@ function lowestCommonAncestor(
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -257,6 +269,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 001. \346\225\264\346\225\260\351\231\244\346\263\225/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 001. \346\225\264\346\225\260\351\231\244\346\263\225/README.md"
index 1f790e890ce10..a3fd364995bde 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 001. \346\225\264\346\225\260\351\231\244\346\263\225/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 001. \346\225\264\346\225\260\351\231\244\346\263\225/README.md"
@@ -82,6 +82,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def divide(self, a: int, b: int) -> int:
@@ -104,6 +106,8 @@ class Solution:
return ans if sign else -ans
```
+#### Java
+
```java
class Solution {
public int divide(int a, int b) {
@@ -132,6 +136,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -161,6 +167,8 @@ public:
};
```
+#### Go
+
```go
func divide(a int, b int) int {
if b == 1 {
@@ -197,6 +205,8 @@ func divide(a int, b int) int {
}
```
+#### TypeScript
+
```ts
function divide(a: number, b: number): number {
if (b === 1) {
@@ -228,6 +238,8 @@ function divide(a: number, b: number): number {
}
```
+#### C#
+
```cs
public class Solution {
public int Divide(int a, int b) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 002. \344\272\214\350\277\233\345\210\266\345\212\240\346\263\225/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 002. \344\272\214\350\277\233\345\210\266\345\212\240\346\263\225/README.md"
index 66db83a18b5b0..2ba8943f6c7e1 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 002. \344\272\214\350\277\233\345\210\266\345\212\240\346\263\225/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 002. \344\272\214\350\277\233\345\210\266\345\212\240\346\263\225/README.md"
@@ -57,12 +57,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def addBinary(self, a: str, b: str) -> str:
return bin(int(a, 2) + int(b, 2))[2:]
```
+#### Java
+
```java
class Solution {
public String addBinary(String a, String b) {
@@ -78,6 +82,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -95,6 +101,8 @@ public:
};
```
+#### Go
+
```go
func addBinary(a string, b string) string {
i, j := len(a)-1, len(b)-1
@@ -116,12 +124,16 @@ func addBinary(a string, b string) string {
}
```
+#### TypeScript
+
```ts
function addBinary(a: string, b: string): string {
return (BigInt('0b' + a) + BigInt('0b' + b)).toString(2);
}
```
+#### Rust
+
```rust
impl Solution {
pub fn add_binary(a: String, b: String) -> String {
@@ -148,6 +160,8 @@ impl Solution {
}
```
+#### C#
+
```cs
public class Solution {
public string AddBinary(string a, string b) {
@@ -177,6 +191,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def addBinary(self, a: str, b: str) -> str:
@@ -190,6 +206,8 @@ class Solution:
return ''.join(ans[::-1])
```
+#### TypeScript
+
```ts
function addBinary(a: string, b: string): string {
let i = a.length - 1;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 003. \345\211\215 n \344\270\252\346\225\260\345\255\227\344\272\214\350\277\233\345\210\266\344\270\255 1 \347\232\204\344\270\252\346\225\260/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 003. \345\211\215 n \344\270\252\346\225\260\345\255\227\344\272\214\350\277\233\345\210\266\344\270\255 1 \347\232\204\344\270\252\346\225\260/README.md"
index ca02529e4d890..502146f5e392d 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 003. \345\211\215 n \344\270\252\346\225\260\345\255\227\344\272\214\350\277\233\345\210\266\344\270\255 1 \347\232\204\344\270\252\346\225\260/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 003. \345\211\215 n \344\270\252\346\225\260\345\255\227\344\272\214\350\277\233\345\210\266\344\270\255 1 \347\232\204\344\270\252\346\225\260/README.md"
@@ -80,6 +80,8 @@ $$
+#### Python3
+
```python
class Solution:
def countBits(self, n: int) -> List[int]:
@@ -89,6 +91,8 @@ class Solution:
return f
```
+#### Java
+
```java
class Solution {
public int[] countBits(int n) {
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -114,6 +120,8 @@ public:
};
```
+#### Go
+
```go
func countBits(n int) []int {
f := make([]int, n+1)
@@ -124,6 +132,8 @@ func countBits(n int) []int {
}
```
+#### TypeScript
+
```ts
function countBits(n: number): number[] {
const f: number[] = Array(n + 1).fill(0);
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 004. \345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\346\225\260\345\255\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 004. \345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\346\225\260\345\255\227/README.md"
index ad2b6854158b0..70f3bc69553fd 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 004. \345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\346\225\260\345\255\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 004. \345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\346\225\260\345\255\227/README.md"
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def singleNumber(self, nums: List[int]) -> int:
@@ -75,6 +77,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int singleNumber(int[] nums) {
@@ -92,6 +96,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -110,6 +116,8 @@ public:
};
```
+#### Go
+
```go
func singleNumber(nums []int) int {
var ans int32
@@ -125,6 +133,8 @@ func singleNumber(nums []int) int {
}
```
+#### TypeScript
+
```ts
function singleNumber(nums: number[]): number {
let ans = 0;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 005. \345\215\225\350\257\215\351\225\277\345\272\246\347\232\204\346\234\200\345\244\247\344\271\230\347\247\257/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 005. \345\215\225\350\257\215\351\225\277\345\272\246\347\232\204\346\234\200\345\244\247\344\271\230\347\247\257/README.md"
index ee875a85c7ef6..02217ef72fa10 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 005. \345\215\225\350\257\215\351\225\277\345\272\246\347\232\204\346\234\200\345\244\247\344\271\230\347\247\257/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 005. \345\215\225\350\257\215\351\225\277\345\272\246\347\232\204\346\234\200\345\244\247\344\271\230\347\247\257/README.md"
@@ -67,6 +67,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def maxProduct(self, words: List[str]) -> int:
@@ -82,6 +84,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int maxProduct(String[] words) {
@@ -105,6 +109,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -130,6 +136,8 @@ public:
};
```
+#### Go
+
```go
func maxProduct(words []string) (ans int) {
n := len(words)
@@ -150,6 +158,8 @@ func maxProduct(words []string) (ans int) {
}
```
+#### TypeScript
+
```ts
function maxProduct(words: string[]): number {
const n = words.length;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 006. \346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\344\270\244\344\270\252\346\225\260\345\255\227\344\271\213\345\222\214/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 006. \346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\344\270\244\344\270\252\346\225\260\345\255\227\344\271\213\345\222\214/README.md"
index b70d23300b748..dbe3f30ab2409 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 006. \346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\344\270\244\344\270\252\346\225\260\345\255\227\344\271\213\345\222\214/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 006. \346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\344\270\244\344\270\252\346\225\260\345\255\227\344\271\213\345\222\214/README.md"
@@ -71,6 +71,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def twoSum(self, numbers: List[int], target: int) -> List[int]:
@@ -82,6 +84,8 @@ class Solution:
return [i, j]
```
+#### Java
+
```java
class Solution {
public int[] twoSum(int[] numbers, int target) {
@@ -104,6 +108,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -119,6 +125,8 @@ public:
};
```
+#### Go
+
```go
func twoSum(numbers []int, target int) []int {
for i, n := 0, len(numbers); ; i++ {
@@ -131,6 +139,8 @@ func twoSum(numbers []int, target int) []int {
}
```
+#### TypeScript
+
```ts
function twoSum(numbers: number[], target: number): number[] {
const n = numbers.length;
@@ -153,6 +163,8 @@ function twoSum(numbers: number[], target: number): number[] {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
@@ -193,6 +205,8 @@ impl Solution {
+#### Python3
+
```python
class Solution:
def twoSum(self, numbers: List[int], target: int) -> List[int]:
@@ -207,6 +221,8 @@ class Solution:
j -= 1
```
+#### Java
+
```java
class Solution {
public int[] twoSum(int[] numbers, int target) {
@@ -225,6 +241,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -244,6 +262,8 @@ public:
};
```
+#### Go
+
```go
func twoSum(numbers []int, target int) []int {
for i, j := 0, len(numbers)-1; ; {
@@ -260,6 +280,8 @@ func twoSum(numbers []int, target int) []int {
}
```
+#### TypeScript
+
```ts
function twoSum(numbers: number[], target: number): number[] {
for (let i = 0, j = numbers.length - 1; ; ) {
@@ -276,6 +298,8 @@ function twoSum(numbers: number[], target: number): number[] {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 007. \346\225\260\347\273\204\344\270\255\345\222\214\344\270\272 0 \347\232\204\344\270\211\344\270\252\346\225\260/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 007. \346\225\260\347\273\204\344\270\255\345\222\214\344\270\272 0 \347\232\204\344\270\211\344\270\252\346\225\260/README.md"
index 524ca70d25028..99cb7fe19aaa7 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 007. \346\225\260\347\273\204\344\270\255\345\222\214\344\270\272 0 \347\232\204\344\270\211\344\270\252\346\225\260/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 007. \346\225\260\347\273\204\344\270\255\345\222\214\344\270\272 0 \347\232\204\344\270\211\344\270\252\346\225\260/README.md"
@@ -79,6 +79,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
@@ -107,6 +109,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List> threeSum(int[] nums) {
@@ -140,6 +144,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -174,6 +180,8 @@ public:
};
```
+#### Go
+
```go
func threeSum(nums []int) (ans [][]int) {
sort.Ints(nums)
@@ -205,6 +213,8 @@ func threeSum(nums []int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function threeSum(nums: number[]): number[][] {
nums.sort((a, b) => a - b);
@@ -237,6 +247,8 @@ function threeSum(nums: number[]): number[][] {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
@@ -280,6 +292,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -316,6 +330,8 @@ var threeSum = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public IList> ThreeSum(int[] nums) {
@@ -349,6 +365,8 @@ public class Solution {
}
```
+#### Ruby
+
```rb
# @param {Integer[]} nums
# @return {Integer[][]}
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 008. \345\222\214\345\244\247\344\272\216\347\255\211\344\272\216 target \347\232\204\346\234\200\347\237\255\345\255\220\346\225\260\347\273\204/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 008. \345\222\214\345\244\247\344\272\216\347\255\211\344\272\216 target \347\232\204\346\234\200\347\237\255\345\255\220\346\225\260\347\273\204/README.md"
index 47afca07897e7..5a5c56cac043a 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 008. \345\222\214\345\244\247\344\272\216\347\255\211\344\272\216 target \347\232\204\346\234\200\347\237\255\345\255\220\346\225\260\347\273\204/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 008. \345\222\214\345\244\247\344\272\216\347\255\211\344\272\216 target \347\232\204\346\234\200\347\237\255\345\255\220\346\225\260\347\273\204/README.md"
@@ -77,6 +77,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def minSubArrayLen(self, target: int, nums: List[int]) -> int:
@@ -91,6 +93,8 @@ class Solution:
return 0 if ans == inf else ans
```
+#### Java
+
```java
class Solution {
public int minSubArrayLen(int target, int[] nums) {
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -129,6 +135,8 @@ public:
};
```
+#### Go
+
```go
func minSubArrayLen(target int, nums []int) int {
const inf = 1 << 30
@@ -149,6 +157,8 @@ func minSubArrayLen(target int, nums []int) int {
}
```
+#### TypeScript
+
```ts
function minSubArrayLen(target: number, nums: number[]): number {
const n = nums.length;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 009. \344\271\230\347\247\257\345\260\217\344\272\216 K \347\232\204\345\255\220\346\225\260\347\273\204/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 009. \344\271\230\347\247\257\345\260\217\344\272\216 K \347\232\204\345\255\220\346\225\260\347\273\204/README.md"
index 18294496adb4a..ec70e74276af0 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 009. \344\271\230\347\247\257\345\260\217\344\272\216 K \347\232\204\345\255\220\346\225\260\347\273\204/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 009. \344\271\230\347\247\257\345\260\217\344\272\216 K \347\232\204\345\255\220\346\225\260\347\273\204/README.md"
@@ -58,6 +58,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def numSubarrayProductLessThanK(self, nums: List[int], k: int) -> int:
@@ -72,6 +74,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int numSubarrayProductLessThanK(int[] nums, int k) {
@@ -89,6 +93,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -107,6 +113,8 @@ public:
};
```
+#### Go
+
```go
func numSubarrayProductLessThanK(nums []int, k int) int {
s := 1
@@ -123,6 +131,8 @@ func numSubarrayProductLessThanK(nums []int, k int) int {
}
```
+#### TypeScript
+
```ts
function numSubarrayProductLessThanK(nums: number[], k: number): number {
let s = 1;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 010. \345\222\214\344\270\272 k \347\232\204\345\255\220\346\225\260\347\273\204/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 010. \345\222\214\344\270\272 k \347\232\204\345\255\220\346\225\260\347\273\204/README.md"
index 051eb58cefc6e..d867da72bb646 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 010. \345\222\214\344\270\272 k \347\232\204\345\255\220\346\225\260\347\273\204/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 010. \345\222\214\344\270\272 k \347\232\204\345\255\220\346\225\260\347\273\204/README.md"
@@ -60,6 +60,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def subarraySum(self, nums: List[int], k: int) -> int:
@@ -72,6 +74,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int subarraySum(int[] nums, int k) {
@@ -88,6 +92,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -105,6 +111,8 @@ public:
};
```
+#### Go
+
```go
func subarraySum(nums []int, k int) (ans int) {
cnt := map[int]int{0: 1}
@@ -118,6 +126,8 @@ func subarraySum(nums []int, k int) (ans int) {
}
```
+#### TypeScript
+
```ts
function subarraySum(nums: number[], k: number): number {
const cnt: Map = new Map();
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 011. 0 \345\222\214 1 \344\270\252\346\225\260\347\233\270\345\220\214\347\232\204\345\255\220\346\225\260\347\273\204/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 011. 0 \345\222\214 1 \344\270\252\346\225\260\347\233\270\345\220\214\347\232\204\345\255\220\346\225\260\347\273\204/README.md"
index a7c56fa23175a..9d2dcc6869729 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 011. 0 \345\222\214 1 \344\270\252\346\225\260\347\233\270\345\220\214\347\232\204\345\255\220\346\225\260\347\273\204/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 011. 0 \345\222\214 1 \344\270\252\346\225\260\347\233\270\345\220\214\347\232\204\345\255\220\346\225\260\347\273\204/README.md"
@@ -58,6 +58,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def findMaxLength(self, nums: List[int]) -> int:
@@ -72,6 +74,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int findMaxLength(int[] nums) {
@@ -91,6 +95,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -112,6 +118,8 @@ public:
};
```
+#### Go
+
```go
func findMaxLength(nums []int) (ans int) {
d := map[int]int{0: -1}
@@ -132,6 +140,8 @@ func findMaxLength(nums []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function findMaxLength(nums: number[]): number {
const d: Map = new Map();
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 012. \345\267\246\345\217\263\344\270\244\350\276\271\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214\347\233\270\347\255\211/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 012. \345\267\246\345\217\263\344\270\244\350\276\271\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214\347\233\270\347\255\211/README.md"
index 84ae23b1ce0dc..46d6f02a41222 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 012. \345\267\246\345\217\263\344\270\244\350\276\271\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214\347\233\270\347\255\211/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 012. \345\267\246\345\217\263\344\270\244\350\276\271\345\255\220\346\225\260\347\273\204\347\232\204\345\222\214\347\233\270\347\255\211/README.md"
@@ -86,6 +86,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def pivotIndex(self, nums: List[int]) -> int:
@@ -98,6 +100,8 @@ class Solution:
return -1
```
+#### Java
+
```java
class Solution {
public int pivotIndex(int[] nums) {
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -137,6 +143,8 @@ public:
};
```
+#### Go
+
```go
func pivotIndex(nums []int) int {
left, right := 0, 0
@@ -154,6 +162,8 @@ func pivotIndex(nums []int) int {
}
```
+#### TypeScript
+
```ts
function pivotIndex(nums: number[]): number {
let left = 0;
@@ -170,6 +180,8 @@ function pivotIndex(nums: number[]): number {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -191,6 +203,8 @@ class Solution {
}
```
+#### C
+
```c
int pivotIndex(int* nums, int numsSize) {
int left, right;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 013. \344\272\214\347\273\264\345\255\220\347\237\251\351\230\265\347\232\204\345\222\214/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 013. \344\272\214\347\273\264\345\255\220\347\237\251\351\230\265\347\232\204\345\222\214/README.md"
index 3103c91f04306..32ca8a9344f3c 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 013. \344\272\214\347\273\264\345\255\220\347\237\251\351\230\265\347\232\204\345\222\214/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 013. \344\272\214\347\273\264\345\255\220\347\237\251\351\230\265\347\232\204\345\222\214/README.md"
@@ -98,6 +98,8 @@ $$
+#### Python3
+
```python
class NumMatrix:
def __init__(self, matrix: List[List[int]]):
@@ -122,6 +124,8 @@ class NumMatrix:
# param_1 = obj.sumRegion(row1,col1,row2,col2)
```
+#### Java
+
```java
class NumMatrix {
private int[][] s;
@@ -149,6 +153,8 @@ class NumMatrix {
*/
```
+#### C++
+
```cpp
class NumMatrix {
public:
@@ -178,6 +184,8 @@ private:
*/
```
+#### Go
+
```go
type NumMatrix struct {
s [][]int
@@ -208,6 +216,8 @@ func (this *NumMatrix) SumRegion(row1 int, col1 int, row2 int, col2 int) int {
*/
```
+#### TypeScript
+
```ts
class NumMatrix {
s: number[][];
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 014. \345\255\227\347\254\246\344\270\262\344\270\255\347\232\204\345\217\230\344\275\215\350\257\215/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 014. \345\255\227\347\254\246\344\270\262\344\270\255\347\232\204\345\217\230\344\275\215\350\257\215/README.md"
index cd05d85371fc2..8e5bfb5f876ba 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 014. \345\255\227\347\254\246\344\270\262\344\270\255\347\232\204\345\217\230\344\275\215\350\257\215/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 014. \345\255\227\347\254\246\344\270\262\344\270\255\347\232\204\345\217\230\344\275\215\350\257\215/README.md"
@@ -65,6 +65,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def checkInclusion(self, s1: str, s2: str) -> bool:
@@ -83,6 +85,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean checkInclusion(String s1, String s2) {
@@ -112,6 +116,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -140,6 +146,8 @@ public:
};
```
+#### Go
+
```go
func checkInclusion(s1 string, s2 string) bool {
m, n := len(s1), len(s2)
@@ -165,6 +173,8 @@ func checkInclusion(s1 string, s2 string) bool {
}
```
+#### TypeScript
+
```ts
function checkInclusion(s1: string, s2: string): boolean {
const m = s1.length;
@@ -206,6 +216,8 @@ function checkInclusion(s1: string, s2: string): boolean {
+#### Python3
+
```python
class Solution:
def checkInclusion(self, s1: str, s2: str) -> bool:
@@ -236,6 +248,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean checkInclusion(String s1, String s2) {
@@ -284,6 +298,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -332,6 +348,8 @@ public:
};
```
+#### Go
+
```go
func checkInclusion(s1 string, s2 string) bool {
m, n := len(s1), len(s2)
@@ -376,6 +394,8 @@ func checkInclusion(s1 string, s2 string) bool {
}
```
+#### TypeScript
+
```ts
function checkInclusion(s1: string, s2: string): boolean {
const m = s1.length;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 015. \345\255\227\347\254\246\344\270\262\344\270\255\347\232\204\346\211\200\346\234\211\345\217\230\344\275\215\350\257\215/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 015. \345\255\227\347\254\246\344\270\262\344\270\255\347\232\204\346\211\200\346\234\211\345\217\230\344\275\215\350\257\215/README.md"
index e03aebbe20b32..ab169635360f3 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 015. \345\255\227\347\254\246\344\270\262\344\270\255\347\232\204\346\211\200\346\234\211\345\217\230\344\275\215\350\257\215/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 015. \345\255\227\347\254\246\344\270\262\344\270\255\347\232\204\346\211\200\346\234\211\345\217\230\344\275\215\350\257\215/README.md"
@@ -71,6 +71,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def findAnagrams(self, s: str, p: str) -> List[int]:
@@ -90,6 +92,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List findAnagrams(String s, String p) {
@@ -120,6 +124,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -150,6 +156,8 @@ public:
};
```
+#### Go
+
```go
func findAnagrams(s string, p string) (ans []int) {
m, n := len(s), len(p)
@@ -175,6 +183,8 @@ func findAnagrams(s string, p string) (ans []int) {
}
```
+#### TypeScript
+
```ts
function findAnagrams(s: string, p: string): number[] {
const m = s.length;
@@ -217,6 +227,8 @@ function findAnagrams(s: string, p: string): number[] {
+#### Python3
+
```python
class Solution:
def findAnagrams(self, s: str, p: str) -> List[int]:
@@ -248,6 +260,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List findAnagrams(String s, String p) {
@@ -297,6 +311,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -346,6 +362,8 @@ public:
};
```
+#### Go
+
```go
func findAnagrams(s string, p string) (ans []int) {
m, n := len(s), len(p)
@@ -390,6 +408,8 @@ func findAnagrams(s string, p string) (ans []int) {
}
```
+#### TypeScript
+
```ts
function findAnagrams(s: string, p: string): number[] {
const m = s.length;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 016. \344\270\215\345\220\253\351\207\215\345\244\215\345\255\227\347\254\246\347\232\204\346\234\200\351\225\277\345\255\220\345\255\227\347\254\246\344\270\262/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 016. \344\270\215\345\220\253\351\207\215\345\244\215\345\255\227\347\254\246\347\232\204\346\234\200\351\225\277\345\255\220\345\255\227\347\254\246\344\270\262/README.md"
index 772785aa1575e..dbfc5a4dbab8b 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 016. \344\270\215\345\220\253\351\207\215\345\244\215\345\255\227\347\254\246\347\232\204\346\234\200\351\225\277\345\255\220\345\255\227\347\254\246\344\270\262/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 016. \344\270\215\345\220\253\351\207\215\345\244\215\345\255\227\347\254\246\347\232\204\346\234\200\351\225\277\345\255\220\345\255\227\347\254\246\344\270\262/README.md"
@@ -76,6 +76,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
@@ -90,6 +92,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int lengthOfLongestSubstring(String s) {
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -128,6 +134,8 @@ public:
};
```
+#### Go
+
```go
func lengthOfLongestSubstring(s string) (ans int) {
ss := make([]bool, 128)
@@ -144,6 +152,8 @@ func lengthOfLongestSubstring(s string) (ans int) {
}
```
+#### TypeScript
+
```ts
function lengthOfLongestSubstring(s: string): number {
let ans = 0;
@@ -169,6 +179,8 @@ function lengthOfLongestSubstring(s: string): number {
+#### TypeScript
+
```ts
function lengthOfLongestSubstring(s: string): number {
let ans = 0;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 017. \345\220\253\346\234\211\346\211\200\346\234\211\345\255\227\347\254\246\347\232\204\346\234\200\347\237\255\345\255\227\347\254\246\344\270\262/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 017. \345\220\253\346\234\211\346\211\200\346\234\211\345\255\227\347\254\246\347\232\204\346\234\200\347\237\255\345\255\227\347\254\246\344\270\262/README.md"
index 3edacc81a805e..df9b8d62e9749 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 017. \345\220\253\346\234\211\346\211\200\346\234\211\345\255\227\347\254\246\347\232\204\346\234\200\347\237\255\345\255\227\347\254\246\344\270\262/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 017. \345\220\253\346\234\211\346\211\200\346\234\211\345\255\227\347\254\246\347\232\204\346\234\200\347\237\255\345\255\227\347\254\246\344\270\262/README.md"
@@ -69,6 +69,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def minWindow(self, s: str, t: str) -> str:
@@ -98,6 +100,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
public String minWindow(String s, String t) {
@@ -136,6 +140,8 @@ class Solution {
}
```
+#### Go
+
```go
func minWindow(s string, t string) string {
m, n := len(s), len(t)
@@ -186,6 +192,8 @@ func check(need, window map[byte]int) bool {
+#### Python3
+
```python
class Solution:
def minWindow(self, s: str, t: str) -> str:
@@ -220,6 +228,8 @@ class Solution:
return "" if minLen == inf else s[start : start + minLen]
```
+#### Java
+
```java
class Solution {
public String minWindow(String s, String t) {
@@ -267,6 +277,8 @@ class Solution {
}
```
+#### Go
+
```go
func minWindow(s string, t string) string {
m, n := len(s), len(t)
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 018. \346\234\211\346\225\210\347\232\204\345\233\236\346\226\207/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 018. \346\234\211\346\225\210\347\232\204\345\233\236\346\226\207/README.md"
index f18af7351997d..bb3de48e35f4e 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 018. \346\234\211\346\225\210\347\232\204\345\233\236\346\226\207/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 018. \346\234\211\346\225\210\347\232\204\345\233\236\346\226\207/README.md"
@@ -58,6 +58,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def isPalindrome(self, s: str) -> bool:
@@ -73,6 +75,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
public boolean isPalindrome(String s) {
@@ -95,6 +99,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -118,6 +124,8 @@ public:
};
```
+#### Go
+
```go
func isPalindrome(s string) bool {
i, j := 0, len(s)-1
@@ -150,6 +158,8 @@ func isalnum(b byte) bool {
}
```
+#### TypeScript
+
```ts
function isPalindrome(s: string): boolean {
const str = s.replace(/[^a-zA-Z0-9]/g, '');
@@ -166,6 +176,8 @@ function isPalindrome(s: string): boolean {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_palindrome(s: String) -> bool {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 019. \346\234\200\345\244\232\345\210\240\351\231\244\344\270\200\344\270\252\345\255\227\347\254\246\345\276\227\345\210\260\345\233\236\346\226\207/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 019. \346\234\200\345\244\232\345\210\240\351\231\244\344\270\200\344\270\252\345\255\227\347\254\246\345\276\227\345\210\260\345\233\236\346\226\207/README.md"
index 742f8ea848b8f..c0a79f7477826 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 019. \346\234\200\345\244\232\345\210\240\351\231\244\344\270\200\344\270\252\345\255\227\347\254\246\345\276\227\345\210\260\345\233\236\346\226\207/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 019. \346\234\200\345\244\232\345\210\240\351\231\244\344\270\200\344\270\252\345\255\227\347\254\246\345\276\227\345\210\260\345\233\236\346\226\207/README.md"
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def validPalindrome(self, s: str) -> bool:
@@ -84,6 +86,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
private String s;
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -131,6 +137,8 @@ public:
};
```
+#### Go
+
```go
func validPalindrome(s string) bool {
check := func(i, j int) bool {
@@ -150,6 +158,8 @@ func validPalindrome(s string) bool {
}
```
+#### TypeScript
+
```ts
function validPalindrome(s: string): boolean {
const check = (i: number, j: number): boolean => {
@@ -169,6 +179,8 @@ function validPalindrome(s: string): boolean {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 020. \345\233\236\346\226\207\345\255\220\345\255\227\347\254\246\344\270\262\347\232\204\344\270\252\346\225\260/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 020. \345\233\236\346\226\207\345\255\220\345\255\227\347\254\246\344\270\262\347\232\204\344\270\252\346\225\260/README.md"
index 160b5fb5e1109..0fa41766af2f5 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 020. \345\233\236\346\226\207\345\255\220\345\255\227\347\254\246\344\270\262\347\232\204\344\270\252\346\225\260/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 020. \345\233\236\346\226\207\345\255\220\345\255\227\347\254\246\344\270\262\347\232\204\344\270\252\346\225\260/README.md"
@@ -59,6 +59,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def countSubstrings(self, s: str) -> int:
@@ -75,6 +77,8 @@ class Solution:
return sum(f(i, i) + f(i, i + 1) for i in range(n))
```
+#### Java
+
```java
class Solution {
private String s;
@@ -99,6 +103,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -120,6 +126,8 @@ public:
};
```
+#### Go
+
```go
func countSubstrings(s string) (ans int) {
n := len(s)
@@ -151,6 +159,8 @@ func countSubstrings(s string) (ans int) {
+#### Python3
+
```python
class Solution:
def countSubstrings(self, s: str) -> int:
@@ -170,6 +180,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int countSubstrings(String s) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 021. \345\210\240\351\231\244\351\223\276\350\241\250\347\232\204\345\200\222\346\225\260\347\254\254 n \344\270\252\347\273\223\347\202\271/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 021. \345\210\240\351\231\244\351\223\276\350\241\250\347\232\204\345\200\222\346\225\260\347\254\254 n \344\270\252\347\273\223\347\202\271/README.md"
index c11a365fc0205..49ef8f9eca0ac 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 021. \345\210\240\351\231\244\351\223\276\350\241\250\347\232\204\345\200\222\346\225\260\347\254\254 n \344\270\252\347\273\223\347\202\271/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 021. \345\210\240\351\231\244\351\223\276\350\241\250\347\232\204\345\200\222\346\225\260\347\254\254 n \344\270\252\347\273\223\347\202\271/README.md"
@@ -67,6 +67,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -86,6 +88,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -114,6 +118,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -144,6 +150,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -169,6 +177,8 @@ func removeNthFromEnd(head *ListNode, n int) *ListNode {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -198,6 +208,8 @@ var removeNthFromEnd = function (head, n) {
};
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 023. \344\270\244\344\270\252\351\223\276\350\241\250\347\232\204\347\254\254\344\270\200\344\270\252\351\207\215\345\220\210\350\212\202\347\202\271/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 023. \344\270\244\344\270\252\351\223\276\350\241\250\347\232\204\347\254\254\344\270\200\344\270\252\351\207\215\345\220\210\350\212\202\347\202\271/README.md"
index 779c125679d0d..66c3f5e291e2f 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 023. \344\270\244\344\270\252\351\223\276\350\241\250\347\232\204\347\254\254\344\270\200\344\270\252\351\207\215\345\220\210\350\212\202\347\202\271/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 023. \344\270\244\344\270\252\351\223\276\350\241\250\347\232\204\347\254\254\344\270\200\344\270\252\351\207\215\345\220\210\350\212\202\347\202\271/README.md"
@@ -100,6 +100,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -117,6 +119,8 @@ class Solution:
return a
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -141,6 +145,8 @@ public class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -163,6 +169,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -189,6 +197,8 @@ func getIntersectionNode(headA, headB *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -213,6 +223,8 @@ function getIntersectionNode(headA: ListNode | null, headB: ListNode | null): Li
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -238,6 +250,8 @@ var getIntersectionNode = function (headA, headB) {
};
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 024. \345\217\215\350\275\254\351\223\276\350\241\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 024. \345\217\215\350\275\254\351\223\276\350\241\250/README.md"
index 1d018c97d9856..8966bcff5d8cb 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 024. \345\217\215\350\275\254\351\223\276\350\241\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 024. \345\217\215\350\275\254\351\223\276\350\241\250/README.md"
@@ -67,6 +67,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -86,6 +88,8 @@ class Solution:
return pre
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -156,6 +164,8 @@ func reverseList(head *ListNode) *ListNode {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -180,6 +190,8 @@ var reverseList = function (head) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -217,6 +229,8 @@ public class Solution {
+#### Java
+
```java
/**
* Definition for singly-linked list.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 025. \351\223\276\350\241\250\344\270\255\347\232\204\344\270\244\346\225\260\347\233\270\345\212\240/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 025. \351\223\276\350\241\250\344\270\255\347\232\204\344\270\244\346\225\260\347\233\270\345\212\240/README.md"
index 9f78feac79163..b6ac6e4222aa3 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 025. \351\223\276\350\241\250\344\270\255\347\232\204\344\270\244\346\225\260\347\233\270\345\212\240/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 025. \351\223\276\350\241\250\344\270\255\347\232\204\344\270\244\346\225\260\347\233\270\345\212\240/README.md"
@@ -68,6 +68,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -93,6 +95,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -127,6 +131,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -165,6 +171,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 026. \351\207\215\346\216\222\351\223\276\350\241\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 026. \351\207\215\346\216\222\351\223\276\350\241\250/README.md"
index 05b2bcdfb913f..e7269f27d746e 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 026. \351\207\215\346\216\222\351\223\276\350\241\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 026. \351\207\215\346\216\222\351\223\276\350\241\250/README.md"
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -105,6 +107,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -162,6 +166,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -222,6 +228,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 027. \345\233\236\346\226\207\351\223\276\350\241\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 027. \345\233\236\346\226\207\351\223\276\350\241\250/README.md"
index ac1c658f20ebf..e9f6d371ff406 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 027. \345\233\236\346\226\207\351\223\276\350\241\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 027. \345\233\236\346\226\207\351\223\276\350\241\250/README.md"
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -86,6 +88,8 @@ class Solution:
return True
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -129,6 +133,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -168,6 +174,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -202,6 +210,8 @@ func isPalindrome(head *ListNode) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -244,6 +254,8 @@ function isPalindrome(head: ListNode | null): boolean {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -286,6 +298,8 @@ var isPalindrome = function (head) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 028. \345\261\225\345\271\263\345\244\232\347\272\247\345\217\214\345\220\221\351\223\276\350\241\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 028. \345\261\225\345\271\263\345\244\232\347\272\247\345\217\214\345\220\221\351\223\276\350\241\250/README.md"
index 0dd100fa80abe..19759fc442666 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 028. \345\261\225\345\271\263\345\244\232\347\272\247\345\217\214\345\220\221\351\223\276\350\241\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 028. \345\261\225\345\271\263\345\244\232\347\272\247\345\217\214\345\220\221\351\223\276\350\241\250/README.md"
@@ -111,6 +111,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
"""
# Definition for a Node.
@@ -148,6 +150,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/*
// Definition for a Node.
@@ -188,6 +192,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/*
// Definition for a Node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 029. \346\216\222\345\272\217\347\232\204\345\276\252\347\216\257\351\223\276\350\241\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 029. \346\216\222\345\272\217\347\232\204\345\276\252\347\216\257\351\223\276\350\241\250/README.md"
index 511fbb2d0dddc..dc157d9ffc2e7 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 029. \346\216\222\345\272\217\347\232\204\345\276\252\347\216\257\351\223\276\350\241\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 029. \346\216\222\345\272\217\347\232\204\345\276\252\347\216\257\351\223\276\350\241\250/README.md"
@@ -73,6 +73,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
"""
# Definition for a Node.
@@ -106,6 +108,8 @@ class Solution:
return head
```
+#### Java
+
```java
/*
// Definition for a Node.
@@ -149,6 +153,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/*
// Definition for a Node.
@@ -192,6 +198,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a Node.
@@ -220,6 +228,8 @@ func insert(head *Node, x int) *Node {
}
```
+#### TypeScript
+
```ts
/**
* Definition for node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 030. \346\217\222\345\205\245\343\200\201\345\210\240\351\231\244\345\222\214\351\232\217\346\234\272\350\256\277\351\227\256\351\203\275\346\230\257 O(1) \347\232\204\345\256\271\345\231\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 030. \346\217\222\345\205\245\343\200\201\345\210\240\351\231\244\345\222\214\351\232\217\346\234\272\350\256\277\351\227\256\351\203\275\346\230\257 O(1) \347\232\204\345\256\271\345\231\250/README.md"
index 4b7579bb98c0c..86add08681ddd 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 030. \346\217\222\345\205\245\343\200\201\345\210\240\351\231\244\345\222\214\351\232\217\346\234\272\350\256\277\351\227\256\351\203\275\346\230\257 O(1) \347\232\204\345\256\271\345\231\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 030. \346\217\222\345\205\245\343\200\201\345\210\240\351\231\244\345\222\214\351\232\217\346\234\272\350\256\277\351\227\256\351\203\275\346\230\257 O(1) \347\232\204\345\256\271\345\231\250/README.md"
@@ -68,6 +68,8 @@ randomSet.getRandom(); // 由于 2 是集合中唯一的数字,getRandom 总
+#### Python3
+
```python
class RandomizedSet:
def __init__(self):
@@ -114,6 +116,8 @@ class RandomizedSet:
# param_3 = obj.getRandom()
```
+#### Java
+
```java
class RandomizedSet {
private final Map m;
@@ -166,6 +170,8 @@ class RandomizedSet {
*/
```
+#### C++
+
```cpp
class RandomizedSet {
unordered_map mp;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 031. \346\234\200\350\277\221\346\234\200\345\260\221\344\275\277\347\224\250\347\274\223\345\255\230/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 031. \346\234\200\350\277\221\346\234\200\345\260\221\344\275\277\347\224\250\347\274\223\345\255\230/README.md"
index ba81fa5c0c030..6fb94e385f1e8 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 031. \346\234\200\350\277\221\346\234\200\345\260\221\344\275\277\347\224\250\347\274\223\345\255\230/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 031. \346\234\200\350\277\221\346\234\200\345\260\221\344\275\277\347\224\250\347\274\223\345\255\230/README.md"
@@ -87,6 +87,8 @@ lRUCache.get(4); // 返回 4
+#### Python3
+
```python
class Node:
def __init__(self, key=0, val=0):
@@ -154,6 +156,8 @@ class LRUCache:
# obj.put(key,value)
```
+#### Java
+
```java
class Node {
int key;
@@ -242,6 +246,8 @@ class LRUCache {
*/
```
+#### C++
+
```cpp
struct Node {
int k;
@@ -336,6 +342,8 @@ private:
*/
```
+#### Go
+
```go
type node struct {
key, val int
@@ -407,6 +415,8 @@ func (this *LRUCache) pushFront(n *node) {
}
```
+#### TypeScript
+
```ts
class LRUCache {
capacity: number;
@@ -443,6 +453,8 @@ class LRUCache {
*/
```
+#### Rust
+
```rust
use std::cell::RefCell;
use std::collections::HashMap;
@@ -574,6 +586,8 @@ impl LRUCache {
*/
```
+#### C#
+
```cs
public class LRUCache {
class Node {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 032. \346\234\211\346\225\210\347\232\204\345\217\230\344\275\215\350\257\215/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 032. \346\234\211\346\225\210\347\232\204\345\217\230\344\275\215\350\257\215/README.md"
index 2581ecadc6edf..aa4bcb0544807 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 032. \346\234\211\346\225\210\347\232\204\345\217\230\344\275\215\350\257\215/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 032. \346\234\211\346\225\210\347\232\204\345\217\230\344\275\215\350\257\215/README.md"
@@ -69,6 +69,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def isAnagram(self, s: str, t: str) -> bool:
@@ -77,6 +79,8 @@ class Solution:
return Counter(s) == Counter(t)
```
+#### Java
+
```java
class Solution {
public boolean isAnagram(String s, String t) {
@@ -100,6 +104,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -124,6 +130,8 @@ public:
};
```
+#### Go
+
```go
func isAnagram(s string, t string) bool {
m, n := len(s), len(t)
@@ -144,6 +152,8 @@ func isAnagram(s string, t string) bool {
}
```
+#### TypeScript
+
```ts
function isAnagram(s: string, t: string): boolean {
const m = s.length;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 033. \345\217\230\344\275\215\350\257\215\347\273\204/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 033. \345\217\230\344\275\215\350\257\215\347\273\204/README.md"
index eaa2837fa6a6c..c8026953e1527 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 033. \345\217\230\344\275\215\350\257\215\347\273\204/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 033. \345\217\230\344\275\215\350\257\215\347\273\204/README.md"
@@ -76,6 +76,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
@@ -86,6 +88,8 @@ class Solution:
return list(d.values())
```
+#### Java
+
```java
class Solution {
public List> groupAnagrams(String[] strs) {
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -118,6 +124,8 @@ public:
};
```
+#### Go
+
```go
func groupAnagrams(strs []string) (ans [][]string) {
d := map[string][]string{}
@@ -134,6 +142,8 @@ func groupAnagrams(strs []string) (ans [][]string) {
}
```
+#### TypeScript
+
```ts
function groupAnagrams(strs: string[]): string[][] {
const d: Map = new Map();
@@ -162,6 +172,8 @@ function groupAnagrams(strs: string[]): string[][] {
+#### Python3
+
```python
class Solution:
def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
@@ -174,6 +186,8 @@ class Solution:
return list(d.values())
```
+#### Java
+
```java
class Solution {
public List> groupAnagrams(String[] strs) {
@@ -197,6 +211,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -221,6 +237,8 @@ public:
};
```
+#### Go
+
```go
func groupAnagrams(strs []string) (ans [][]string) {
d := map[[26]int][]string{}
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 034. \345\244\226\346\230\237\350\257\255\350\250\200\346\230\257\345\220\246\346\216\222\345\272\217/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 034. \345\244\226\346\230\237\350\257\255\350\250\200\346\230\257\345\220\246\346\216\222\345\272\217/README.md"
index 69c6840418ed1..f57a93736cee3 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 034. \345\244\226\346\230\237\350\257\255\350\250\200\346\230\257\345\220\246\346\216\222\345\272\217/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 034. \345\244\226\346\230\237\350\257\255\350\250\200\346\230\257\345\220\246\346\216\222\345\272\217/README.md"
@@ -64,6 +64,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def isAlienSorted(self, words: List[str], order: str) -> bool:
@@ -86,6 +88,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
public boolean isAlienSorted(String[] words, String order) {
@@ -115,6 +119,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -140,6 +146,8 @@ public:
};
```
+#### Go
+
```go
func isAlienSorted(words []string, order string) bool {
index := make(map[byte]int)
@@ -167,6 +175,8 @@ func isAlienSorted(words []string, order string) bool {
}
```
+#### TypeScript
+
```ts
function isAlienSorted(words: string[], order: string): boolean {
let charMap = new Map();
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 035. \346\234\200\345\260\217\346\227\266\351\227\264\345\267\256/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 035. \346\234\200\345\260\217\346\227\266\351\227\264\345\267\256/README.md"
index ba651433c1aa1..981d1cb6e3ad0 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 035. \346\234\200\345\260\217\346\227\266\351\227\264\345\267\256/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 035. \346\234\200\345\260\217\346\227\266\351\227\264\345\267\256/README.md"
@@ -62,6 +62,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def findMinDifference(self, timePoints: List[str]) -> int:
@@ -72,6 +74,8 @@ class Solution:
return min(b - a for a, b in pairwise(mins))
```
+#### Java
+
```java
class Solution {
public int findMinDifference(List timePoints) {
@@ -94,6 +98,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -116,6 +122,8 @@ public:
};
```
+#### Go
+
```go
func findMinDifference(timePoints []string) int {
if len(timePoints) > 24*60 {
@@ -138,6 +146,8 @@ func findMinDifference(timePoints []string) int {
}
```
+#### TypeScript
+
```ts
function findMinDifference(timePoints: string[]): number {
if (timePoints.length > 24 * 60) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 036. \345\220\216\347\274\200\350\241\250\350\276\276\345\274\217/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 036. \345\220\216\347\274\200\350\241\250\350\276\276\345\274\217/README.md"
index 997e60c417b01..ff26a2361d9f8 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 036. \345\220\216\347\274\200\350\241\250\350\276\276\345\274\217/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 036. \345\220\216\347\274\200\350\241\250\350\276\276\345\274\217/README.md"
@@ -98,6 +98,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def evalRPN(self, tokens: List[str]) -> int:
@@ -118,6 +120,8 @@ class Solution:
return nums[0]
```
+#### Java
+
```java
class Solution {
public int evalRPN(String[] tokens) {
@@ -149,6 +153,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -177,6 +183,8 @@ public:
};
```
+#### Go
+
```go
func evalRPN(tokens []string) int {
// https://github.com/emirpasic/gods#arraystack
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 037. \345\260\217\350\241\214\346\230\237\347\242\260\346\222\236/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 037. \345\260\217\350\241\214\346\230\237\347\242\260\346\222\236/README.md"
index e8c54aede73ce..fb3b6354cce33 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 037. \345\260\217\350\241\214\346\230\237\347\242\260\346\222\236/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 037. \345\260\217\350\241\214\346\230\237\347\242\260\346\222\236/README.md"
@@ -80,6 +80,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def asteroidCollision(self, asteroids: List[int]) -> List[int]:
@@ -97,6 +99,8 @@ class Solution:
return stk
```
+#### Java
+
```java
class Solution {
public int[] asteroidCollision(int[] asteroids) {
@@ -120,6 +124,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -144,6 +150,8 @@ public:
};
```
+#### Go
+
```go
func asteroidCollision(asteroids []int) (stk []int) {
for _, x := range asteroids {
@@ -164,6 +172,8 @@ func asteroidCollision(asteroids []int) (stk []int) {
}
```
+#### TypeScript
+
```ts
function asteroidCollision(asteroids: number[]): number[] {
const stk: number[] = [];
@@ -185,6 +195,8 @@ function asteroidCollision(asteroids: number[]): number[] {
}
```
+#### Rust
+
```rust
impl Solution {
#[allow(dead_code)]
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 038. \346\257\217\346\227\245\346\270\251\345\272\246/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 038. \346\257\217\346\227\245\346\270\251\345\272\246/README.md"
index 1610997f1fe73..dfda38aee573c 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 038. \346\257\217\346\227\245\346\270\251\345\272\246/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 038. \346\257\217\346\227\245\346\270\251\345\272\246/README.md"
@@ -68,6 +68,8 @@ for i in range(n):
+#### Python3
+
```python
class Solution:
def dailyTemperatures(self, temperatures: List[int]) -> List[int]:
@@ -81,6 +83,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] dailyTemperatures(int[] temperatures) {
@@ -99,6 +103,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -118,6 +124,8 @@ public:
};
```
+#### Go
+
```go
func dailyTemperatures(temperatures []int) []int {
ans := make([]int, len(temperatures))
@@ -134,6 +142,8 @@ func dailyTemperatures(temperatures []int) []int {
}
```
+#### TypeScript
+
```ts
function dailyTemperatures(temperatures: number[]): number[] {
const n = temperatures.length;
@@ -150,6 +160,8 @@ function dailyTemperatures(temperatures: number[]): number[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn daily_temperatures(temperatures: Vec) -> Vec {
@@ -178,6 +190,8 @@ impl Solution {
+#### Python3
+
```python
class Solution:
def dailyTemperatures(self, temperatures: List[int]) -> List[int]:
@@ -193,6 +207,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] dailyTemperatures(int[] temperatures) {
@@ -213,6 +229,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -230,6 +248,8 @@ public:
};
```
+#### Go
+
```go
func dailyTemperatures(temperatures []int) []int {
n := len(temperatures)
@@ -248,6 +268,8 @@ func dailyTemperatures(temperatures []int) []int {
}
```
+#### TypeScript
+
```ts
function dailyTemperatures(temperatures: number[]): number[] {
const n = temperatures.length;
@@ -265,6 +287,8 @@ function dailyTemperatures(temperatures: number[]): number[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn daily_temperatures(temperatures: Vec) -> Vec {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 039. \347\233\264\346\226\271\345\233\276\346\234\200\345\244\247\347\237\251\345\275\242\351\235\242\347\247\257/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 039. \347\233\264\346\226\271\345\233\276\346\234\200\345\244\247\347\237\251\345\275\242\351\235\242\347\247\257/README.md"
index 37dc6ad3a9bef..0f92c4a6a385f 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 039. \347\233\264\346\226\271\345\233\276\346\234\200\345\244\247\347\237\251\345\275\242\351\235\242\347\247\257/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 039. \347\233\264\346\226\271\345\233\276\346\234\200\345\244\247\347\237\251\345\275\242\351\235\242\347\247\257/README.md"
@@ -59,6 +59,8 @@ for i in range(n):
+#### Python3
+
```python
class Solution:
def largestRectangleArea(self, heights: List[int]) -> int:
@@ -82,6 +84,8 @@ class Solution:
return max(x * (r - l - 1) for x, l, r in zip(heights, left, right))
```
+#### Java
+
```java
class Solution {
public int largestRectangleArea(int[] heights) {
@@ -121,6 +125,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -156,6 +162,8 @@ public:
};
```
+#### Go
+
```go
func largestRectangleArea(heights []int) (ans int) {
n := len(heights)
@@ -192,6 +200,8 @@ func largestRectangleArea(heights []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function largestRectangleArea(heights: number[]): number {
const n = heights.length;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 040. \347\237\251\351\230\265\344\270\255\346\234\200\345\244\247\347\232\204\347\237\251\345\275\242/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 040. \347\237\251\351\230\265\344\270\255\346\234\200\345\244\247\347\232\204\347\237\251\345\275\242/README.md"
index e3d7ac298a689..5d7912e6036bc 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 040. \347\237\251\351\230\265\344\270\255\346\234\200\345\244\247\347\232\204\347\237\251\345\275\242/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 040. \347\237\251\351\230\265\344\270\255\346\234\200\345\244\247\347\232\204\347\237\251\345\275\242/README.md"
@@ -84,6 +84,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def maximalRectangle(self, matrix: List[List[str]]) -> int:
@@ -122,6 +124,8 @@ class Solution:
return max(h * (right[i] - left[i] - 1) for i, h in enumerate(heights))
```
+#### Java
+
```java
class Solution {
public int maximalRectangle(String[] matrix) {
@@ -165,6 +169,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -199,6 +205,8 @@ public:
};
```
+#### Go
+
```go
func maximalRectangle(matrix []string) int {
if len(matrix) == 0 {
@@ -256,6 +264,8 @@ func largestRectangleArea(heights []int) int {
+#### C++
+
```cpp
class Solution {
public:
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 041. \346\273\221\345\212\250\347\252\227\345\217\243\347\232\204\345\271\263\345\235\207\345\200\274/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 041. \346\273\221\345\212\250\347\252\227\345\217\243\347\232\204\345\271\263\345\235\207\345\200\274/README.md"
index 41073c4c2a807..2cfa24adecd46 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 041. \346\273\221\345\212\250\347\252\227\345\217\243\347\232\204\345\271\263\345\235\207\345\200\274/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 041. \346\273\221\345\212\250\347\252\227\345\217\243\347\232\204\345\271\263\345\235\207\345\200\274/README.md"
@@ -63,6 +63,8 @@ movingAverage.next(5); // 返回 6.0 = (10 + 3 + 5) / 3
+#### Python3
+
```python
class MovingAverage:
def __init__(self, size: int):
@@ -83,6 +85,8 @@ class MovingAverage:
# param_1 = obj.next(val)
```
+#### Java
+
```java
class MovingAverage {
private int[] arr;
@@ -109,6 +113,8 @@ class MovingAverage {
*/
```
+#### C++
+
```cpp
class MovingAverage {
public:
@@ -137,6 +143,8 @@ private:
*/
```
+#### Go
+
```go
type MovingAverage struct {
arr []int
@@ -174,6 +182,8 @@ func (this *MovingAverage) Next(val int) float64 {
+#### Python3
+
```python
class MovingAverage:
def __init__(self, size: int):
@@ -194,6 +204,8 @@ class MovingAverage:
# param_1 = obj.next(val)
```
+#### Java
+
```java
class MovingAverage {
private Deque q = new ArrayDeque<>();
@@ -221,6 +233,8 @@ class MovingAverage {
*/
```
+#### C++
+
```cpp
class MovingAverage {
public:
@@ -251,6 +265,8 @@ private:
*/
```
+#### Go
+
```go
type MovingAverage struct {
q []int
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 042. \346\234\200\350\277\221\350\257\267\346\261\202\346\254\241\346\225\260/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 042. \346\234\200\350\277\221\350\257\267\346\261\202\346\254\241\346\225\260/README.md"
index 984d8a5587f78..5d5c5a84345f7 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 042. \346\234\200\350\277\221\350\257\267\346\261\202\346\254\241\346\225\260/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 042. \346\234\200\350\277\221\350\257\267\346\261\202\346\254\241\346\225\260/README.md"
@@ -65,6 +65,8 @@ recentCounter.ping(3002); // requests = [1, 100, 3001<
+#### Python3
+
```python
class RecentCounter:
def __init__(self):
@@ -82,6 +84,8 @@ class RecentCounter:
# param_1 = obj.ping(t)
```
+#### Java
+
```java
class RecentCounter {
private Deque q;
@@ -106,6 +110,8 @@ class RecentCounter {
*/
```
+#### C++
+
```cpp
class RecentCounter {
public:
@@ -130,6 +136,8 @@ public:
*/
```
+#### Go
+
```go
type RecentCounter struct {
q []int
@@ -156,6 +164,8 @@ func (this *RecentCounter) Ping(t int) int {
*/
```
+#### TypeScript
+
```ts
class RecentCounter {
stack: Array;
@@ -177,6 +187,8 @@ class RecentCounter {
}
```
+#### JavaScript
+
```js
var RecentCounter = function () {
this.q = [];
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 043. \345\276\200\345\256\214\345\205\250\344\272\214\345\217\211\346\240\221\346\267\273\345\212\240\350\212\202\347\202\271/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 043. \345\276\200\345\256\214\345\205\250\344\272\214\345\217\211\346\240\221\346\267\273\345\212\240\350\212\202\347\202\271/README.md"
index 62999f7887c27..3f6d02b516a05 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 043. \345\276\200\345\256\214\345\205\250\344\272\214\345\217\211\346\240\221\346\267\273\345\212\240\350\212\202\347\202\271/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 043. \345\276\200\345\256\214\345\205\250\344\272\214\345\217\211\346\240\221\346\267\273\345\212\240\350\212\202\347\202\271/README.md"
@@ -72,6 +72,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -113,6 +115,8 @@ class CBTInserter:
# param_2 = obj.get_root()
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -174,6 +178,8 @@ class CBTInserter {
*/
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -233,6 +239,8 @@ private:
*/
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -289,6 +297,8 @@ func (this *CBTInserter) Get_root() *TreeNode {
*/
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -348,6 +358,8 @@ class CBTInserter {
*/
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 044. \344\272\214\345\217\211\346\240\221\346\257\217\345\261\202\347\232\204\346\234\200\345\244\247\345\200\274/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 044. \344\272\214\345\217\211\346\240\221\346\257\217\345\261\202\347\232\204\346\234\200\345\244\247\345\200\274/README.md"
index c341aa9eb0778..4327065e9f0de 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 044. \344\272\214\345\217\211\346\240\221\346\257\217\345\261\202\347\232\204\346\234\200\345\244\247\345\200\274/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 044. \344\272\214\345\217\211\346\240\221\346\257\217\345\261\202\347\232\204\346\234\200\345\244\247\345\200\274/README.md"
@@ -87,6 +87,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -113,6 +115,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -156,6 +160,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -190,6 +196,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 045. \344\272\214\345\217\211\346\240\221\346\234\200\345\272\225\345\261\202\346\234\200\345\267\246\350\276\271\347\232\204\345\200\274/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 045. \344\272\214\345\217\211\346\240\221\346\234\200\345\272\225\345\261\202\346\234\200\345\267\246\350\276\271\347\232\204\345\200\274/README.md"
index 32ee02daa8bf0..f595a764c17af 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 045. \344\272\214\345\217\211\346\240\221\346\234\200\345\272\225\345\261\202\346\234\200\345\267\246\350\276\271\347\232\204\345\200\274/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 045. \344\272\214\345\217\211\346\240\221\346\234\200\345\272\225\345\261\202\346\234\200\345\267\246\350\276\271\347\232\204\345\200\274/README.md"
@@ -58,6 +58,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -82,6 +84,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -123,6 +127,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -155,6 +161,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 046. \344\272\214\345\217\211\346\240\221\347\232\204\345\217\263\344\276\247\350\247\206\345\233\276/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 046. \344\272\214\345\217\211\346\240\221\347\232\204\345\217\263\344\276\247\350\247\206\345\233\276/README.md"
index 32c42edda7a9a..e1b1246dd0e50 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 046. \344\272\214\345\217\211\346\240\221\347\232\204\345\217\263\344\276\247\350\247\206\345\233\276/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 046. \344\272\214\345\217\211\346\240\221\347\232\204\345\217\263\344\276\247\350\247\206\345\233\276/README.md"
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -86,6 +88,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -127,6 +131,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -160,6 +166,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 047. \344\272\214\345\217\211\346\240\221\345\211\252\346\236\235/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 047. \344\272\214\345\217\211\346\240\221\345\211\252\346\236\235/README.md"
index 63af0f6e3316d..4e6ed3f28fb9c 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 047. \344\272\214\345\217\211\346\240\221\345\211\252\346\236\235/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 047. \344\272\214\345\217\211\346\240\221\345\211\252\346\236\235/README.md"
@@ -72,6 +72,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -90,6 +92,8 @@ class Solution:
return root
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -121,6 +125,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -145,6 +151,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -167,6 +175,8 @@ func pruneTree(root *TreeNode) *TreeNode {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 048. \345\272\217\345\210\227\345\214\226\344\270\216\345\217\215\345\272\217\345\210\227\345\214\226\344\272\214\345\217\211\346\240\221/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 048. \345\272\217\345\210\227\345\214\226\344\270\216\345\217\215\345\272\217\345\210\227\345\214\226\344\272\214\345\217\211\346\240\221/README.md"
index 233009fc46d93..8749d37a5ebae 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 048. \345\272\217\345\210\227\345\214\226\344\270\216\345\217\215\345\272\217\345\210\227\345\214\226\344\272\214\345\217\211\346\240\221/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 048. \345\272\217\345\210\227\345\214\226\344\270\216\345\217\215\345\272\217\345\210\227\345\214\226\344\272\214\345\217\211\346\240\221/README.md"
@@ -71,6 +71,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode(object):
@@ -128,6 +130,8 @@ class Codec:
# ans = deser.deserialize(ser.serialize(root))
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -192,6 +196,8 @@ public class Codec {
// TreeNode ans = deser.deserialize(ser.serialize(root));
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -245,6 +251,8 @@ public:
// TreeNode* ans = deser.deserialize(ser.serialize(root));
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 049. \344\273\216\346\240\271\350\212\202\347\202\271\345\210\260\345\217\266\350\212\202\347\202\271\347\232\204\350\267\257\345\276\204\346\225\260\345\255\227\344\271\213\345\222\214/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 049. \344\273\216\346\240\271\350\212\202\347\202\271\345\210\260\345\217\266\350\212\202\347\202\271\347\232\204\350\267\257\345\276\204\346\225\260\345\255\227\344\271\213\345\222\214/README.md"
index 2fbd5789e75fb..97c3c351d6cd9 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 049. \344\273\216\346\240\271\350\212\202\347\202\271\345\210\260\345\217\266\350\212\202\347\202\271\347\232\204\350\267\257\345\276\204\346\225\260\345\255\227\344\271\213\345\222\214/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 049. \344\273\216\346\240\271\350\212\202\347\202\271\345\210\260\345\217\266\350\212\202\347\202\271\347\232\204\350\267\257\345\276\204\346\225\260\345\255\227\344\271\213\345\222\214/README.md"
@@ -75,6 +75,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -95,6 +97,8 @@ class Solution:
return dfs(root, 0)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -129,6 +133,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -156,6 +162,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 050. \345\220\221\344\270\213\347\232\204\350\267\257\345\276\204\350\212\202\347\202\271\344\271\213\345\222\214/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 050. \345\220\221\344\270\213\347\232\204\350\267\257\345\276\204\350\212\202\347\202\271\344\271\213\345\222\214/README.md"
index c9dc56e4a71fc..627a2e551cf8b 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 050. \345\220\221\344\270\213\347\232\204\350\267\257\345\276\204\350\212\202\347\202\271\344\271\213\345\222\214/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 050. \345\220\221\344\270\213\347\232\204\350\267\257\345\276\204\350\212\202\347\202\271\344\271\213\345\222\214/README.md"
@@ -74,6 +74,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -98,6 +100,8 @@ class Solution:
return dfs(root, 0)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -139,6 +143,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -170,6 +176,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -197,6 +205,8 @@ func pathSum(root *TreeNode, targetSum int) int {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 051. \350\212\202\347\202\271\344\271\213\345\222\214\346\234\200\345\244\247\347\232\204\350\267\257\345\276\204/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 051. \350\212\202\347\202\271\344\271\213\345\222\214\346\234\200\345\244\247\347\232\204\350\267\257\345\276\204/README.md"
index 171320d41c3f5..b850973fd3069 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 051. \350\212\202\347\202\271\344\271\213\345\222\214\346\234\200\345\244\247\347\232\204\350\267\257\345\276\204/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 051. \350\212\202\347\202\271\344\271\213\345\222\214\346\234\200\345\244\247\347\232\204\350\267\257\345\276\204/README.md"
@@ -81,6 +81,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -104,6 +106,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -140,6 +144,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -171,6 +177,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -197,6 +205,8 @@ func maxPathSum(root *TreeNode) int {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -228,6 +238,8 @@ function maxPathSum(root: TreeNode | null): number {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -269,6 +281,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -298,6 +312,8 @@ var maxPathSum = function (root) {
};
```
+#### C#
+
```cs
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 052. \345\261\225\345\271\263\344\272\214\345\217\211\346\220\234\347\264\242\346\240\221/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 052. \345\261\225\345\271\263\344\272\214\345\217\211\346\220\234\347\264\242\346\240\221/README.md"
index 76cb0df557547..df64c0c17e332 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 052. \345\261\225\345\271\263\344\272\214\345\217\211\346\220\234\347\264\242\346\240\221/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 052. \345\261\225\345\271\263\344\272\214\345\217\211\346\220\234\347\264\242\346\240\221/README.md"
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -83,6 +85,8 @@ class Solution:
return head
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -124,6 +128,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -163,6 +169,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -196,6 +204,8 @@ func increasingBST(root *TreeNode) *TreeNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -228,6 +238,8 @@ function increasingBST(root: TreeNode | null): TreeNode | null {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -282,6 +294,8 @@ impl Solution {
}
```
+#### C
+
```c
/**
* Definition for a binary tree node.
@@ -322,6 +336,8 @@ struct TreeNode* increasingBST(struct TreeNode* root) {
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -349,6 +365,8 @@ class Solution:
return dummy.right
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -388,6 +406,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -421,6 +441,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 053. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\255\347\232\204\344\270\255\345\272\217\345\220\216\347\273\247/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 053. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\255\347\232\204\344\270\255\345\272\217\345\220\216\347\273\247/README.md"
index d4b7fcf9aade9..e71ad2348788c 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 053. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\255\347\232\204\344\270\255\345\272\217\345\220\216\347\273\247/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 053. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\255\347\232\204\344\270\255\345\272\217\345\220\216\347\273\247/README.md"
@@ -72,6 +72,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -93,6 +95,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -119,6 +123,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -146,6 +152,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -168,6 +176,8 @@ func inorderSuccessor(root *TreeNode, p *TreeNode) (ans *TreeNode) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 054. \346\211\200\346\234\211\345\244\247\344\272\216\347\255\211\344\272\216\350\212\202\347\202\271\347\232\204\345\200\274\344\271\213\345\222\214/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 054. \346\211\200\346\234\211\345\244\247\344\272\216\347\255\211\344\272\216\350\212\202\347\202\271\347\232\204\345\200\274\344\271\213\345\222\214/README.md"
index 97326843b0b3c..b3bb91480d1d8 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 054. \346\211\200\346\234\211\345\244\247\344\272\216\347\255\211\344\272\216\350\212\202\347\202\271\347\232\204\345\200\274\344\271\213\345\222\214/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 054. \346\211\200\346\234\211\345\244\247\344\272\216\347\255\211\344\272\216\350\212\202\347\202\271\347\232\204\345\200\274\344\271\213\345\222\214/README.md"
@@ -89,6 +89,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -112,6 +114,8 @@ class Solution:
return root
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -148,6 +152,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -179,6 +185,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -205,6 +213,8 @@ func convertBST(root *TreeNode) *TreeNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -236,6 +246,8 @@ function convertBST(root: TreeNode | null): TreeNode | null {
}
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -274,6 +286,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -326,6 +340,8 @@ Morris 遍历无需使用栈,时间复杂度 $O(n)$,空间复杂度为 $O(1)
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -357,6 +373,8 @@ class Solution:
return node
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -403,6 +421,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -446,6 +466,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 055. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\350\277\255\344\273\243\345\231\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 055. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\350\277\255\344\273\243\345\231\250/README.md"
index 978cc07f152e3..1e89618224d5b 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 055. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\350\277\255\344\273\243\345\231\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 055. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\350\277\255\344\273\243\345\231\250/README.md"
@@ -89,6 +89,8 @@ bSTIterator.hasNext(); // 返回 False
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -123,6 +125,8 @@ class BSTIterator:
# param_2 = obj.hasNext()
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -172,6 +176,8 @@ class BSTIterator {
*/
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -218,6 +224,8 @@ public:
*/
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -262,6 +270,8 @@ func (this *BSTIterator) HasNext() bool {
*/
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
@@ -307,6 +317,8 @@ class BSTIterator {
*/
```
+#### Rust
+
```rust
// Definition for a binary tree node.
// #[derive(Debug, PartialEq, Eq)]
@@ -371,6 +383,8 @@ impl BSTIterator {
*/
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
@@ -431,6 +445,8 @@ BSTIterator.prototype.hasNext = function () {
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -463,6 +479,8 @@ class BSTIterator:
# param_2 = obj.hasNext()
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -509,6 +527,8 @@ class BSTIterator {
*/
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 056. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\255\344\270\244\344\270\252\350\212\202\347\202\271\344\271\213\345\222\214/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 056. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\255\344\270\244\344\270\252\350\212\202\347\202\271\344\271\213\345\222\214/README.md"
index 6cbc6d36f1e3b..0a9ec43f73dda 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 056. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\255\344\270\244\344\270\252\350\212\202\347\202\271\344\271\213\345\222\214/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 056. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\344\270\255\344\270\244\344\270\252\350\212\202\347\202\271\344\271\213\345\222\214/README.md"
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -77,6 +79,8 @@ class Solution:
return find(root)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -114,6 +118,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -143,6 +149,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -170,6 +178,8 @@ func findTarget(root *TreeNode, k int) bool {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 057. \345\200\274\345\222\214\344\270\213\346\240\207\344\271\213\345\267\256\351\203\275\345\234\250\347\273\231\345\256\232\347\232\204\350\214\203\345\233\264\345\206\205/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 057. \345\200\274\345\222\214\344\270\213\346\240\207\344\271\213\345\267\256\351\203\275\345\234\250\347\273\231\345\256\232\347\232\204\350\214\203\345\233\264\345\206\205/README.md"
index 29eb95f16c65f..74f1f0511ac5d 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 057. \345\200\274\345\222\214\344\270\213\346\240\207\344\271\213\345\267\256\351\203\275\345\234\250\347\273\231\345\256\232\347\232\204\350\214\203\345\233\264\345\206\205/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 057. \345\200\274\345\222\214\344\270\213\346\240\207\344\271\213\345\267\256\351\203\275\345\234\250\347\273\231\345\256\232\347\232\204\350\214\203\345\233\264\345\206\205/README.md"
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
from sortedcontainers import SortedSet
@@ -83,6 +85,8 @@ class Solution:
return False
```
+#### Java
+
```java
class Solution {
public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {
@@ -102,6 +106,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -118,6 +124,8 @@ public:
};
```
+#### Go
+
```go
func containsNearbyAlmostDuplicate(nums []int, k int, t int) bool {
n := len(nums)
@@ -142,6 +150,8 @@ func containsNearbyAlmostDuplicate(nums []int, k int, t int) bool {
}
```
+#### TypeScript
+
```ts
function containsNearbyAlmostDuplicate(nums: number[], k: number, t: number): boolean {
const ts = new TreeSet();
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 058. \346\227\245\347\250\213\350\241\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 058. \346\227\245\347\250\213\350\241\250/README.md"
index e26dfefcde67e..44344ad0365b6 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 058. \346\227\245\347\250\213\350\241\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 058. \346\227\245\347\250\213\350\241\250/README.md"
@@ -62,6 +62,8 @@ MyCalendar.book(20, 30); // returns true ,第三个日程安排可以添加到
+#### Python3
+
```python
from sortedcontainers import SortedDict
@@ -84,6 +86,8 @@ class MyCalendar:
# param_1 = obj.book(start,end)
```
+#### Java
+
```java
import java.util.Map;
import java.util.TreeMap;
@@ -115,6 +119,8 @@ class MyCalendar {
*/
```
+#### Go
+
```go
type MyCalendar struct {
rbt *redblacktree.Tree
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 059. \346\225\260\346\215\256\346\265\201\347\232\204\347\254\254 K \345\244\247\346\225\260\345\200\274/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 059. \346\225\260\346\215\256\346\265\201\347\232\204\347\254\254 K \345\244\247\346\225\260\345\200\274/README.md"
index 092d3932e2188..493a1956e73a9 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 059. \346\225\260\346\215\256\346\265\201\347\232\204\347\254\254 K \345\244\247\346\225\260\345\200\274/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 059. \346\225\260\346\215\256\346\265\201\347\232\204\347\254\254 K \345\244\247\346\225\260\345\200\274/README.md"
@@ -67,6 +67,8 @@ kthLargest.add(4); // return 8
+#### Python3
+
```python
class KthLargest:
def __init__(self, k: int, nums: List[int]):
@@ -87,6 +89,8 @@ class KthLargest:
# param_1 = obj.add(val)
```
+#### Java
+
```java
class KthLargest {
private PriorityQueue q;
@@ -116,6 +120,8 @@ class KthLargest {
*/
```
+#### C++
+
```cpp
class KthLargest {
public:
@@ -141,6 +147,8 @@ public:
*/
```
+#### Go
+
```go
type KthLargest struct {
h *IntHeap
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 060. \345\207\272\347\216\260\351\242\221\347\216\207\346\234\200\351\253\230\347\232\204 k \344\270\252\346\225\260\345\255\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 060. \345\207\272\347\216\260\351\242\221\347\216\207\346\234\200\351\253\230\347\232\204 k \344\270\252\346\225\260\345\255\227/README.md"
index 258618ba2db4a..bb48542187c42 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 060. \345\207\272\347\216\260\351\242\221\347\216\207\346\234\200\351\253\230\347\232\204 k \344\270\252\346\225\260\345\255\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 060. \345\207\272\347\216\260\351\242\221\347\216\207\346\234\200\351\253\230\347\232\204 k \344\270\252\346\225\260\345\255\227/README.md"
@@ -60,6 +60,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def topKFrequent(self, nums: List[int], k: int) -> List[int]:
@@ -67,6 +69,8 @@ class Solution:
return [v[0] for v in cnt.most_common(k)]
```
+#### Java
+
```java
class Solution {
public int[] topKFrequent(int[] nums, int k) {
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
using pii = pair;
@@ -109,6 +115,8 @@ public:
};
```
+#### Go
+
```go
func topKFrequent(nums []int, k int) []int {
cnt := map[int]int{}
@@ -139,6 +147,8 @@ func (h *hp) Push(v any) { *h = append(*h, v.(pair)) }
func (h *hp) Pop() any { a := *h; v := a[len(a)-1]; *h = a[:len(a)-1]; return v }
```
+#### TypeScript
+
```ts
function topKFrequent(nums: number[], k: number): number[] {
let hashMap = new Map();
@@ -155,6 +165,8 @@ function topKFrequent(nums: number[], k: number): number[] {
}
```
+#### Rust
+
```rust
use std::collections::HashMap;
impl Solution {
@@ -196,6 +208,8 @@ impl Solution {
+#### Python3
+
```python
class Solution:
def topKFrequent(self, nums: List[int], k: int) -> List[int]:
@@ -208,6 +222,8 @@ class Solution:
return [v[1] for v in hp]
```
+#### Java
+
```java
class Solution {
public int[] topKFrequent(int[] nums, int k) {
@@ -231,6 +247,8 @@ class Solution {
}
```
+#### TypeScript
+
```ts
function topKFrequent(nums: number[], k: number): number[] {
const map = new Map();
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 061. \345\222\214\346\234\200\345\260\217\347\232\204 k \344\270\252\346\225\260\345\257\271/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 061. \345\222\214\346\234\200\345\260\217\347\232\204 k \344\270\252\346\225\260\345\257\271/README.md"
index 9d0c17f8f2c77..15aabddd202fb 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 061. \345\222\214\346\234\200\345\260\217\347\232\204 k \344\270\252\346\225\260\345\257\271/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 061. \345\222\214\346\234\200\345\260\217\347\232\204 k \344\270\252\346\225\260\345\257\271/README.md"
@@ -70,6 +70,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def kSmallestPairs(
@@ -84,6 +86,8 @@ class Solution:
return [p for _, p in hp]
```
+#### Java
+
```java
class Solution {
public List> kSmallestPairs(int[] nums1, int[] nums2, int k) {
@@ -102,6 +106,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
type pairHeap [][]int
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 062. \345\256\236\347\216\260\345\211\215\347\274\200\346\240\221/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 062. \345\256\236\347\216\260\345\211\215\347\274\200\346\240\221/README.md"
index 8172de6793834..c65ee5b910192 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 062. \345\256\236\347\216\260\345\211\215\347\274\200\346\240\221/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 062. \345\256\236\347\216\260\345\211\215\347\274\200\346\240\221/README.md"
@@ -94,6 +94,8 @@ trie.search("app"); // 返回 True
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -134,6 +136,8 @@ class Trie:
# param_3 = obj.startsWith(prefix)
```
+#### Java
+
```java
class Trie {
private Trie[] children;
@@ -187,6 +191,8 @@ class Trie {
*/
```
+#### C++
+
```cpp
class Trie {
private:
@@ -238,6 +244,8 @@ public:
*/
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
@@ -291,6 +299,8 @@ func (this *Trie) SearchPrefix(s string) *Trie {
*/
```
+#### JavaScript
+
```js
/**
* Initialize your data structure here.
@@ -352,6 +362,8 @@ Trie.prototype.startsWith = function (prefix) {
*/
```
+#### C#
+
```cs
public class Trie {
bool isEnd;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 063. \346\233\277\346\215\242\345\215\225\350\257\215/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 063. \346\233\277\346\215\242\345\215\225\350\257\215/README.md"
index b4fc661f8c99e..6198c8eca2931 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 063. \346\233\277\346\215\242\345\215\225\350\257\215/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 063. \346\233\277\346\215\242\345\215\225\350\257\215/README.md"
@@ -84,6 +84,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def replaceWords(self, dictionary: List[str], sentence: str) -> str:
@@ -97,6 +99,8 @@ class Solution:
return ' '.join(words)
```
+#### Java
+
```java
class Solution {
public String replaceWords(List dictionary, String sentence) {
@@ -117,6 +121,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -144,6 +150,8 @@ public:
};
```
+#### Go
+
```go
func replaceWords(dictionary []string, sentence string) string {
s := map[string]bool{}
@@ -174,6 +182,8 @@ func replaceWords(dictionary []string, sentence string) string {
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -209,6 +219,8 @@ class Solution:
return ' '.join(trie.search(v) for v in sentence.split())
```
+#### Java
+
```java
class Trie {
Trie[] children = new Trie[26];
@@ -257,6 +269,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Trie {
public:
@@ -305,6 +319,8 @@ public:
};
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 064. \347\245\236\345\245\207\347\232\204\345\255\227\345\205\270/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 064. \347\245\236\345\245\207\347\232\204\345\255\227\345\205\270/README.md"
index 3f2f0fe80a232..29c7473d49328 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 064. \347\245\236\345\245\207\347\232\204\345\255\227\345\205\270/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 064. \347\245\236\345\245\207\347\232\204\345\255\227\345\205\270/README.md"
@@ -76,6 +76,8 @@ magicDictionary.search("leetcoded"); // 返回 False
+#### Python3
+
```python
class MagicDictionary:
def __init__(self):
@@ -105,6 +107,8 @@ class MagicDictionary:
# param_2 = obj.search(searchWord)
```
+#### Java
+
```java
class MagicDictionary {
private Set words;
@@ -156,6 +160,8 @@ class MagicDictionary {
*/
```
+#### C++
+
```cpp
class MagicDictionary {
public:
@@ -201,6 +207,8 @@ private:
*/
```
+#### Go
+
```go
type MagicDictionary struct {
words map[string]bool
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 065. \346\234\200\347\237\255\347\232\204\345\215\225\350\257\215\347\274\226\347\240\201/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 065. \346\234\200\347\237\255\347\232\204\345\215\225\350\257\215\347\274\226\347\240\201/README.md"
index ad4df0267569c..879a1b2817d3f 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 065. \346\234\200\347\237\255\347\232\204\345\215\225\350\257\215\347\274\226\347\240\201/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 065. \346\234\200\347\237\255\347\232\204\345\215\225\350\257\215\347\274\226\347\240\201/README.md"
@@ -70,6 +70,8 @@ words[2] = "bell" ,s 开始于 indices[2] = 5 到下一个 '#
+#### Python3
+
```python
class Trie:
def __init__(self) -> None:
@@ -99,6 +101,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Trie {
Trie[] children = new Trie[26];
@@ -137,6 +141,8 @@ class Solution {
}
```
+#### C++
+
```cpp
struct Trie {
Trie* children[26] = {nullptr};
@@ -176,6 +182,8 @@ private:
};
```
+#### Go
+
```go
type trie struct {
children [26]*trie
@@ -220,6 +228,8 @@ func dfs(cur *trie, l int) int {
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -244,6 +254,8 @@ class Solution:
return sum(trie.insert(w[::-1]) for w in words)
```
+#### Java
+
```java
class Trie {
Trie[] children = new Trie[26];
@@ -276,6 +288,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Trie {
public:
@@ -313,6 +327,8 @@ public:
};
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 066. \345\215\225\350\257\215\344\271\213\345\222\214/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 066. \345\215\225\350\257\215\344\271\213\345\222\214/README.md"
index d4eb2cf22774b..ac892f1b46e05 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 066. \345\215\225\350\257\215\344\271\213\345\222\214/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 066. \345\215\225\350\257\215\344\271\213\345\222\214/README.md"
@@ -63,6 +63,8 @@ mapSum.sum("ap"); // return 5 (apple + app = 3
+#### Python3
+
```python
class MapSum:
def __init__(self):
@@ -88,6 +90,8 @@ class MapSum:
# param_2 = obj.sum(prefix)
```
+#### Java
+
```java
class MapSum {
private Map data;
@@ -121,6 +125,8 @@ class MapSum {
*/
```
+#### C++
+
```cpp
class MapSum {
public:
@@ -153,6 +159,8 @@ public:
*/
```
+#### Go
+
```go
type MapSum struct {
data map[string]int
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 067. \346\234\200\345\244\247\347\232\204\345\274\202\346\210\226/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 067. \346\234\200\345\244\247\347\232\204\345\274\202\346\210\226/README.md"
index c2bdb061d4c87..7594245e1227f 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 067. \346\234\200\345\244\247\347\232\204\345\274\202\346\210\226/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 067. \346\234\200\345\244\247\347\232\204\345\274\202\346\210\226/README.md"
@@ -81,6 +81,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def findMaximumXOR(self, nums: List[int]) -> int:
@@ -103,6 +105,8 @@ class Solution:
return max
```
+#### Java
+
```java
class Solution {
@@ -132,6 +136,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Trie {
public:
@@ -180,6 +186,8 @@ public:
};
```
+#### Go
+
```go
type Trie struct {
children [26]*Trie
@@ -243,6 +251,8 @@ func findMaximumXOR(nums []int) int {
+#### Python3
+
```python
class Trie:
def __init__(self):
@@ -278,6 +288,8 @@ class Solution:
return max(trie.search(v) for v in nums)
```
+#### Java
+
```java
class Trie {
Trie[] children = new Trie[2];
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 068. \346\237\245\346\211\276\346\217\222\345\205\245\344\275\215\347\275\256/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 068. \346\237\245\346\211\276\346\217\222\345\205\245\344\275\215\347\275\256/README.md"
index 9cb6f5f7b878b..2b1cbbb176a52 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 068. \346\237\245\346\211\276\346\217\222\345\205\245\344\275\215\347\275\256/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 068. \346\237\245\346\211\276\346\217\222\345\205\245\344\275\215\347\275\256/README.md"
@@ -77,6 +77,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
@@ -90,6 +92,8 @@ class Solution:
return left
```
+#### Java
+
```java
class Solution {
public int searchInsert(int[] nums, int target) {
@@ -107,6 +111,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -124,6 +130,8 @@ public:
};
```
+#### Go
+
```go
func searchInsert(nums []int, target int) int {
left, right := 0, len(nums)
@@ -139,6 +147,8 @@ func searchInsert(nums []int, target int) int {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 069. \345\261\261\345\263\260\346\225\260\347\273\204\347\232\204\351\241\266\351\203\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 069. \345\261\261\345\263\260\346\225\260\347\273\204\347\232\204\351\241\266\351\203\250/README.md"
index 19fa59bd4164b..6cb4dd2436f82 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 069. \345\261\261\345\263\260\346\225\260\347\273\204\347\232\204\351\241\266\351\203\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 069. \345\261\261\345\263\260\346\225\260\347\273\204\347\232\204\351\241\266\351\203\250/README.md"
@@ -90,6 +90,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def peakIndexInMountainArray(self, arr: List[int]) -> int:
@@ -103,6 +105,8 @@ class Solution:
return left
```
+#### Java
+
```java
class Solution {
public int peakIndexInMountainArray(int[] arr) {
@@ -120,6 +124,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -137,6 +143,8 @@ public:
};
```
+#### Go
+
```go
func peakIndexInMountainArray(arr []int) int {
left, right := 1, len(arr)-2
@@ -152,6 +160,8 @@ func peakIndexInMountainArray(arr []int) int {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} arr
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 070. \346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\346\225\260\345\255\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 070. \346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\346\225\260\345\255\227/README.md"
index f10fcc140da56..ed8879be28bf6 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 070. \346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\346\225\260\345\255\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 070. \346\216\222\345\272\217\346\225\260\347\273\204\344\270\255\345\217\252\345\207\272\347\216\260\344\270\200\346\254\241\347\232\204\346\225\260\345\255\227/README.md"
@@ -60,6 +60,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def singleNonDuplicate(self, nums: List[int]) -> int:
@@ -74,6 +76,8 @@ class Solution:
return nums[left]
```
+#### Java
+
```java
class Solution {
public int singleNonDuplicate(int[] nums) {
@@ -93,6 +97,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -110,6 +116,8 @@ public:
};
```
+#### Go
+
```go
func singleNonDuplicate(nums []int) int {
left, right := 0, len(nums)-1
@@ -125,6 +133,8 @@ func singleNonDuplicate(nums []int) int {
}
```
+#### TypeScript
+
```ts
function singleNonDuplicate(nums: number[]): number {
let left = 0,
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 071. \346\214\211\346\235\203\351\207\215\347\224\237\346\210\220\351\232\217\346\234\272\346\225\260/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 071. \346\214\211\346\235\203\351\207\215\347\224\237\346\210\220\351\232\217\346\234\272\346\225\260/README.md"
index c3a393ce2ba35..fc2a5d09cc0be 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 071. \346\214\211\346\235\203\351\207\215\347\224\237\346\210\220\351\232\217\346\234\272\346\225\260/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 071. \346\214\211\346\235\203\351\207\215\347\224\237\346\210\220\351\232\217\346\234\272\346\225\260/README.md"
@@ -84,6 +84,8 @@ solution.pickIndex(); // 返回 0,返回下标 0,返回该下标概率为 1/
+#### Python3
+
```python
class Solution:
def __init__(self, w: List[int]):
@@ -110,6 +112,8 @@ class Solution:
# param_1 = obj.pickIndex()
```
+#### Java
+
```java
class Solution {
private int[] presum;
@@ -145,6 +149,8 @@ class Solution {
*/
```
+#### C++
+
```cpp
class Solution {
public:
@@ -178,6 +184,8 @@ public:
*/
```
+#### Go
+
```go
type Solution struct {
presum []int
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 072. \346\261\202\345\271\263\346\226\271\346\240\271/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 072. \346\261\202\345\271\263\346\226\271\346\240\271/README.md"
index 4995f41392486..e5a3f00d1894b 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 072. \346\261\202\345\271\263\346\226\271\346\240\271/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 072. \346\261\202\345\271\263\346\226\271\346\240\271/README.md"
@@ -43,6 +43,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def mySqrt(self, x: int) -> int:
@@ -57,6 +59,8 @@ class Solution:
return left
```
+#### Java
+
```java
class Solution {
public int mySqrt(int x) {
@@ -75,6 +79,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -92,6 +98,8 @@ public:
};
```
+#### Go
+
```go
func mySqrt(x int) int {
left, right := 0, x
@@ -107,6 +115,8 @@ func mySqrt(x int) int {
}
```
+#### JavaScript
+
```js
/**
* @param {number} x
@@ -127,6 +137,8 @@ var mySqrt = function (x) {
};
```
+#### C#
+
```cs
public class Solution {
public int MySqrt(int x) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 073. \347\213\222\347\213\222\345\220\203\351\246\231\350\225\211/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 073. \347\213\222\347\213\222\345\220\203\351\246\231\350\225\211/README.md"
index 1e9665b6c2b8c..e690c64d1aabe 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 073. \347\213\222\347\213\222\345\220\203\351\246\231\350\225\211/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 073. \347\213\222\347\213\222\345\220\203\351\246\231\350\225\211/README.md"
@@ -69,6 +69,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def minEatingSpeed(self, piles: List[int], h: int) -> int:
@@ -83,6 +85,8 @@ class Solution:
return left
```
+#### Java
+
```java
class Solution {
public int minEatingSpeed(int[] piles, int h) {
@@ -108,6 +112,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -127,6 +133,8 @@ public:
};
```
+#### Go
+
```go
func minEatingSpeed(piles []int, h int) int {
left, right := 1, slices.Max(piles)
@@ -146,6 +154,8 @@ func minEatingSpeed(piles []int, h int) int {
}
```
+#### C#
+
```cs
public class Solution {
public int MinEatingSpeed(int[] piles, int h) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 074. \345\220\210\345\271\266\345\214\272\351\227\264/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 074. \345\220\210\345\271\266\345\214\272\351\227\264/README.md"
index 4879d00981438..85910bed4d7ee 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 074. \345\220\210\345\271\266\345\214\272\351\227\264/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 074. \345\220\210\345\271\266\345\214\272\351\227\264/README.md"
@@ -73,6 +73,8 @@ def merge(intervals):
+#### Python3
+
```python
class Solution:
def merge(self, intervals: List[List[int]]) -> List[List[int]]:
@@ -89,6 +91,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[][] merge(int[][] intervals) {
@@ -111,6 +115,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -132,6 +138,8 @@ public:
};
```
+#### Go
+
```go
func merge(intervals [][]int) [][]int {
sort.Slice(intervals, func(i, j int) bool {
@@ -152,6 +160,8 @@ func merge(intervals [][]int) [][]int {
}
```
+#### C#
+
```cs
public class Solution {
public int[][] Merge(int[][] intervals) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 075. \346\225\260\347\273\204\347\233\270\345\257\271\346\216\222\345\272\217/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 075. \346\225\260\347\273\204\347\233\270\345\257\271\346\216\222\345\272\217/README.md"
index ace9ab8ce0a1a..979fe1952d23a 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 075. \346\225\260\347\273\204\347\233\270\345\257\271\346\216\222\345\272\217/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 075. \346\225\260\347\273\204\347\233\270\345\257\271\346\216\222\345\272\217/README.md"
@@ -54,6 +54,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def relativeSortArray(self, arr1: List[int], arr2: List[int]) -> List[int]:
@@ -62,6 +64,8 @@ class Solution:
return arr1
```
+#### Java
+
```java
class Solution {
public int[] relativeSortArray(int[] arr1, int[] arr2) {
@@ -85,6 +89,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -103,6 +109,8 @@ public:
};
```
+#### Go
+
```go
func relativeSortArray(arr1 []int, arr2 []int) []int {
mp := make([]int, 1001)
@@ -138,6 +146,8 @@ func relativeSortArray(arr1 []int, arr2 []int) []int {
+#### Python3
+
```python
class Solution:
def relativeSortArray(self, arr1: List[int], arr2: List[int]) -> List[int]:
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 076. \346\225\260\347\273\204\344\270\255\347\232\204\347\254\254 k \345\244\247\347\232\204\346\225\260\345\255\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 076. \346\225\260\347\273\204\344\270\255\347\232\204\347\254\254 k \345\244\247\347\232\204\346\225\260\345\255\227/README.md"
index 1de846365e4bc..3832f7087e47a 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 076. \346\225\260\347\273\204\344\270\255\347\232\204\347\254\254 k \345\244\247\347\232\204\346\225\260\345\255\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 076. \346\225\260\347\273\204\344\270\255\347\232\204\347\254\254 k \345\244\247\347\232\204\346\225\260\345\255\227/README.md"
@@ -53,6 +53,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def findKthLargest(self, nums: List[int], k: int) -> int:
@@ -80,6 +82,8 @@ class Solution:
return quick_sort(0, n - 1, n - k)
```
+#### Java
+
```java
class Solution {
public int findKthLargest(int[] nums, int k) {
@@ -112,6 +116,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
func findKthLargest(nums []int, k int) int {
n := len(nums)
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 077. \351\223\276\350\241\250\346\216\222\345\272\217/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 077. \351\223\276\350\241\250\346\216\222\345\272\217/README.md"
index 58f2ceded4203..2cf786ba9d063 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 077. \351\223\276\350\241\250\346\216\222\345\272\217/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 077. \351\223\276\350\241\250\346\216\222\345\272\217/README.md"
@@ -70,6 +70,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -100,6 +102,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -143,6 +147,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -186,6 +192,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -226,6 +234,8 @@ func sortList(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -270,6 +280,8 @@ function sortList(head: ListNode | null): ListNode | null {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -313,6 +325,8 @@ var sortList = function (head) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 078. \345\220\210\345\271\266\346\216\222\345\272\217\351\223\276\350\241\250/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 078. \345\220\210\345\271\266\346\216\222\345\272\217\351\223\276\350\241\250/README.md"
index f4194aeb631e1..46dda02934b66 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 078. \345\220\210\345\271\266\346\216\222\345\272\217\351\223\276\350\241\250/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 078. \345\220\210\345\271\266\346\216\222\345\272\217\351\223\276\350\241\250/README.md"
@@ -73,6 +73,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -103,6 +105,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -145,6 +149,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -185,6 +191,8 @@ private:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -226,6 +234,8 @@ func mergeTwoLists(l1 *ListNode, l2 *ListNode) *ListNode {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -267,6 +277,8 @@ function mergeTwoLists(l1, l2) {
}
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -310,6 +322,8 @@ public class Solution {
}
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 079. \346\211\200\346\234\211\345\255\220\351\233\206/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 079. \346\211\200\346\234\211\345\255\220\351\233\206/README.md"
index 579c398d4f94a..f923f68cfd386 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 079. \346\211\200\346\234\211\345\255\220\351\233\206/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 079. \346\211\200\346\234\211\345\255\220\351\233\206/README.md"
@@ -55,6 +55,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def subsets(self, nums: List[int]) -> List[List[int]]:
@@ -73,6 +75,8 @@ class Solution:
return res
```
+#### Java
+
```java
class Solution {
public List> subsets(int[] nums) {
@@ -95,6 +99,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -117,6 +123,8 @@ public:
};
```
+#### Go
+
```go
func subsets(nums []int) [][]int {
var res [][]int
@@ -138,6 +146,8 @@ func dfs(i int, nums, t []int, res *[][]int) {
}
```
+#### TypeScript
+
```ts
function subsets(nums: number[]): number[][] {
const n = nums.length;
@@ -155,6 +165,8 @@ function subsets(nums: number[]): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(mut i: usize, t: &mut Vec, ans: &mut Vec>, nums: &Vec) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 080. \345\220\253\346\234\211 k \344\270\252\345\205\203\347\264\240\347\232\204\347\273\204\345\220\210/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 080. \345\220\253\346\234\211 k \344\270\252\345\205\203\347\264\240\347\232\204\347\273\204\345\220\210/README.md"
index a1e596018b05f..e35ccea2e7284 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 080. \345\220\253\346\234\211 k \344\270\252\345\205\203\347\264\240\347\232\204\347\273\204\345\220\210/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 080. \345\220\253\346\234\211 k \344\270\252\345\205\203\347\264\240\347\232\204\347\273\204\345\220\210/README.md"
@@ -58,6 +58,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def combine(self, n: int, k: int) -> List[List[int]]:
@@ -76,6 +78,8 @@ class Solution:
return res
```
+#### Java
+
```java
class Solution {
public List> combine(int n, int k) {
@@ -98,6 +102,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -122,6 +128,8 @@ public:
};
```
+#### Go
+
```go
func combine(n int, k int) [][]int {
var res [][]int
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 081. \345\205\201\350\256\270\351\207\215\345\244\215\351\200\211\346\213\251\345\205\203\347\264\240\347\232\204\347\273\204\345\220\210/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 081. \345\205\201\350\256\270\351\207\215\345\244\215\351\200\211\346\213\251\345\205\203\347\264\240\347\232\204\347\273\204\345\220\210/README.md"
index 1dcef51f44306..5ea16337e40df 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 081. \345\205\201\350\256\270\351\207\215\345\244\215\351\200\211\346\213\251\345\205\203\347\264\240\347\232\204\347\273\204\345\220\210/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 081. \345\205\201\350\256\270\351\207\215\345\244\215\351\200\211\346\213\251\345\205\203\347\264\240\347\232\204\347\273\204\345\220\210/README.md"
@@ -78,6 +78,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
@@ -100,6 +102,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans;
@@ -132,6 +136,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -163,6 +169,8 @@ public:
};
```
+#### Go
+
```go
func combinationSum(candidates []int, target int) [][]int {
var ans [][]int
@@ -190,6 +198,8 @@ func combinationSum(candidates []int, target int) [][]int {
}
```
+#### C#
+
```cs
using System;
using System.Collections.Generic;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 082. \345\220\253\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\347\273\204\345\220\210/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 082. \345\220\253\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\347\273\204\345\220\210/README.md"
index 32095304ebb19..eff8b96dd4837 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 082. \345\220\253\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\347\273\204\345\220\210/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 082. \345\220\253\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\347\273\204\345\220\210/README.md"
@@ -63,6 +63,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]:
@@ -85,6 +87,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans;
@@ -120,6 +124,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -153,6 +159,8 @@ public:
};
```
+#### Go
+
```go
func combinationSum2(candidates []int, target int) [][]int {
var ans [][]int
@@ -182,6 +190,8 @@ func combinationSum2(candidates []int, target int) [][]int {
}
```
+#### C#
+
```cs
using System;
using System.Collections.Generic;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 083. \346\262\241\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\345\205\250\346\216\222\345\210\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 083. \346\262\241\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\345\205\250\346\216\222\345\210\227/README.md"
index 9955e190977e1..2114fa3d9b8e6 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 083. \346\262\241\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\345\205\250\346\216\222\345\210\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 083. \346\262\241\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\345\205\250\346\216\222\345\210\227/README.md"
@@ -60,6 +60,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
@@ -83,6 +85,8 @@ class Solution:
return res
```
+#### Java
+
```java
class Solution {
public List> permute(int[] nums) {
@@ -113,6 +117,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -142,6 +148,8 @@ public:
};
```
+#### Go
+
```go
func permute(nums []int) [][]int {
n := len(nums)
@@ -170,6 +178,8 @@ func dfs(u, n int, nums []int, used []bool, path []int, res *[][]int) {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -201,6 +211,8 @@ function dfs(u, n, nums, used, path, res) {
}
```
+#### C#
+
```cs
using System.Collections.Generic;
using System.Linq;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 084. \345\220\253\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\345\205\250\346\216\222\345\210\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 084. \345\220\253\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\345\205\250\346\216\222\345\210\227/README.md"
index 17abc1ab77d7c..998bcffb292d6 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 084. \345\220\253\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\345\205\250\346\216\222\345\210\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 084. \345\220\253\346\234\211\351\207\215\345\244\215\345\205\203\347\264\240\351\233\206\345\220\210\347\232\204\345\205\250\346\216\222\345\210\227/README.md"
@@ -55,6 +55,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def permuteUnique(self, nums: List[int]) -> List[List[int]]:
@@ -80,6 +82,8 @@ class Solution:
return res
```
+#### Java
+
```java
class Solution {
public List> permuteUnique(int[] nums) {
@@ -112,6 +116,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -141,6 +147,8 @@ public:
};
```
+#### Go
+
```go
func permuteUnique(nums []int) [][]int {
n := len(nums)
@@ -171,6 +179,8 @@ func dfs(u, n int, nums []int, used []bool, path []int, res *[][]int) {
}
```
+#### C#
+
```cs
using System.Collections.Generic;
using System.Linq;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 085. \347\224\237\346\210\220\345\214\271\351\205\215\347\232\204\346\213\254\345\217\267/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 085. \347\224\237\346\210\220\345\214\271\351\205\215\347\232\204\346\213\254\345\217\267/README.md"
index 17d42d71ca580..80e7c55cfd3ff 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 085. \347\224\237\346\210\220\345\214\271\351\205\215\347\232\204\346\213\254\345\217\267/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 085. \347\224\237\346\210\220\345\214\271\351\205\215\347\232\204\346\213\254\345\217\267/README.md"
@@ -51,6 +51,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
@@ -68,6 +70,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List generateParenthesis(int n) {
@@ -91,6 +95,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -111,6 +117,8 @@ public:
};
```
+#### Go
+
```go
func generateParenthesis(n int) []string {
var ans []string
@@ -132,6 +140,8 @@ func generateParenthesis(n int) []string {
}
```
+#### TypeScript
+
```ts
function generateParenthesis(n: number): string[] {
let ans = [];
@@ -152,6 +162,8 @@ function generateParenthesis(n: number): string[] {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 086. \345\210\206\345\211\262\345\233\236\346\226\207\345\255\220\345\255\227\347\254\246\344\270\262/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 086. \345\210\206\345\211\262\345\233\236\346\226\207\345\255\220\345\255\227\347\254\246\344\270\262/README.md"
index a44fe687c27dc..29b5e9db2fcee 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 086. \345\210\206\345\211\262\345\233\236\346\226\207\345\255\220\345\255\227\347\254\246\344\270\262/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 086. \345\210\206\345\211\262\345\233\236\346\226\207\345\255\220\345\255\227\347\254\246\344\270\262/README.md"
@@ -70,6 +70,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def partition(self, s: str) -> List[List[str]]:
@@ -94,6 +96,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private int n;
@@ -134,6 +138,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -167,6 +173,8 @@ public:
};
```
+#### Go
+
```go
func partition(s string) (ans [][]string) {
n := len(s)
@@ -202,6 +210,8 @@ func partition(s string) (ans [][]string) {
}
```
+#### TypeScript
+
```ts
function partition(s: string): string[][] {
const n = s.length;
@@ -231,6 +241,8 @@ function partition(s: string): string[][] {
}
```
+#### C#
+
```cs
public class Solution {
private int n;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 087. \345\244\215\345\216\237 IP/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 087. \345\244\215\345\216\237 IP/README.md"
index 890c11f2570df..68621fb5d7e99 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 087. \345\244\215\345\216\237 IP/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 087. \345\244\215\345\216\237 IP/README.md"
@@ -87,6 +87,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def restoreIpAddresses(self, s: str) -> List[str]:
@@ -114,6 +116,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private int n;
@@ -150,6 +154,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -182,6 +188,8 @@ public:
};
```
+#### Go
+
```go
func restoreIpAddresses(s string) (ans []string) {
n := len(s)
@@ -211,6 +219,8 @@ func restoreIpAddresses(s string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function restoreIpAddresses(s: string): string[] {
const n = s.length;
@@ -240,6 +250,8 @@ function restoreIpAddresses(s: string): string[] {
}
```
+#### C#
+
```cs
public class Solution {
private IList ans = new List();
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 088. \347\210\254\346\245\274\346\242\257\347\232\204\346\234\200\345\260\221\346\210\220\346\234\254/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 088. \347\210\254\346\245\274\346\242\257\347\232\204\346\234\200\345\260\221\346\210\220\346\234\254/README.md"
index 1a03e8b674b43..e4430696431d1 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 088. \347\210\254\346\245\274\346\242\257\347\232\204\346\234\200\345\260\221\346\210\220\346\234\254/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 088. \347\210\254\346\245\274\346\242\257\347\232\204\346\234\200\345\260\221\346\210\220\346\234\254/README.md"
@@ -72,6 +72,8 @@ $$
+#### Python3
+
```python
class Solution:
def minCostClimbingStairs(self, cost: List[int]) -> int:
@@ -82,6 +84,8 @@ class Solution:
return dp[-1]
```
+#### Java
+
```java
class Solution {
public int minCostClimbingStairs(int[] cost) {
@@ -95,6 +99,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -109,6 +115,8 @@ public:
};
```
+#### Go
+
```go
func minCostClimbingStairs(cost []int) int {
n := len(cost)
@@ -120,6 +128,8 @@ func minCostClimbingStairs(cost []int) int {
}
```
+#### TypeScript
+
```ts
function minCostClimbingStairs(cost: number[]): number {
const n = cost.length;
@@ -141,6 +151,8 @@ function minCostClimbingStairs(cost: number[]): number {
+#### Python3
+
```python
class Solution:
def minCostClimbingStairs(self, cost: List[int]) -> int:
@@ -150,6 +162,8 @@ class Solution:
return b
```
+#### Java
+
```java
class Solution {
public int minCostClimbingStairs(int[] cost) {
@@ -164,6 +178,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -179,6 +195,8 @@ public:
};
```
+#### Go
+
```go
func minCostClimbingStairs(cost []int) int {
a, b := 0, 0
@@ -189,6 +207,8 @@ func minCostClimbingStairs(cost []int) int {
}
```
+#### TypeScript
+
```ts
function minCostClimbingStairs(cost: number[]): number {
let a = 0,
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 089. \346\210\277\345\261\213\345\201\267\347\233\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 089. \346\210\277\345\261\213\345\201\267\347\233\227/README.md"
index 8d5c72a74997d..95dba6daa7ebc 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 089. \346\210\277\345\261\213\345\201\267\347\233\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 089. \346\210\277\345\261\213\345\201\267\347\233\227/README.md"
@@ -81,6 +81,8 @@ $$
+#### Python3
+
```python
class Solution:
def rob(self, nums: List[int]) -> int:
@@ -92,6 +94,8 @@ class Solution:
return f[n]
```
+#### Java
+
```java
class Solution {
public int rob(int[] nums) {
@@ -106,6 +110,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -122,6 +128,8 @@ public:
};
```
+#### Go
+
```go
func rob(nums []int) int {
n := len(nums)
@@ -134,6 +142,8 @@ func rob(nums []int) int {
}
```
+#### TypeScript
+
```ts
function rob(nums: number[]): number {
const n = nums.length;
@@ -146,6 +156,8 @@ function rob(nums: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn rob(nums: Vec) -> i32 {
@@ -168,6 +180,8 @@ impl Solution {
+#### Python3
+
```python
class Solution:
def rob(self, nums: List[int]) -> int:
@@ -177,6 +191,8 @@ class Solution:
return max(f, g)
```
+#### Java
+
```java
class Solution {
public int rob(int[] nums) {
@@ -191,6 +207,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -206,6 +224,8 @@ public:
};
```
+#### Go
+
```go
func rob(nums []int) int {
f, g := 0, 0
@@ -216,6 +236,8 @@ func rob(nums []int) int {
}
```
+#### TypeScript
+
```ts
function rob(nums: number[]): number {
let [f, g] = [0, 0];
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 090. \347\216\257\345\275\242\346\210\277\345\261\213\345\201\267\347\233\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 090. \347\216\257\345\275\242\346\210\277\345\261\213\345\201\267\347\233\227/README.md"
index a7c6c952fa70c..cbdde236ac876 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 090. \347\216\257\345\275\242\346\210\277\345\261\213\345\201\267\347\233\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 090. \347\216\257\345\275\242\346\210\277\345\261\213\345\201\267\347\233\227/README.md"
@@ -67,6 +67,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def rob(self, nums: List[int]) -> int:
@@ -81,6 +83,8 @@ class Solution:
return max(_rob(nums[1:]), _rob(nums[:-1]))
```
+#### Java
+
```java
class Solution {
public int rob(int[] nums) {
@@ -103,6 +107,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
func rob(nums []int) int {
n := len(nums)
@@ -144,6 +152,8 @@ func robRange(nums []int, l, r int) int {
}
```
+#### TypeScript
+
```ts
function rob(nums: number[]): number {
const n = nums.length;
@@ -161,6 +171,8 @@ function rob(nums: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn rob(nums: Vec) -> i32 {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 091. \347\262\211\345\210\267\346\210\277\345\255\220/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 091. \347\262\211\345\210\267\346\210\277\345\255\220/README.md"
index 20ea967ec252b..f47a979f234bd 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 091. \347\262\211\345\210\267\346\210\277\345\255\220/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 091. \347\262\211\345\210\267\346\210\277\345\255\220/README.md"
@@ -62,6 +62,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def minCost(self, costs: List[List[int]]) -> int:
@@ -74,6 +76,8 @@ class Solution:
return min(r, g, b)
```
+#### Java
+
```java
class Solution {
public int minCost(int[][] costs) {
@@ -89,6 +93,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -105,6 +111,8 @@ public:
};
```
+#### Go
+
```go
func minCost(costs [][]int) int {
r, g, b := 0, 0, 0
@@ -118,6 +126,8 @@ func minCost(costs [][]int) int {
}
```
+#### TypeScript
+
```ts
function minCost(costs: number[][]): number {
let [r, g, b] = [0, 0, 0];
@@ -128,6 +138,8 @@ function minCost(costs: number[][]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn min_cost(costs: Vec>) -> i32 {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 092. \347\277\273\350\275\254\345\255\227\347\254\246/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 092. \347\277\273\350\275\254\345\255\227\347\254\246/README.md"
index 8854e1d8e83d3..799a58460f4de 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 092. \347\277\273\350\275\254\345\255\227\347\254\246/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 092. \347\277\273\350\275\254\345\255\227\347\254\246/README.md"
@@ -72,6 +72,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def minFlipsMonoIncr(self, s: str) -> int:
@@ -86,6 +88,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int minFlipsMonoIncr(String s) {
@@ -108,6 +112,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -129,6 +135,8 @@ public:
};
```
+#### Go
+
```go
func minFlipsMonoIncr(s string) int {
n := len(s)
@@ -152,6 +160,8 @@ func minFlipsMonoIncr(s string) int {
}
```
+#### TypeScript
+
```ts
function minFlipsMonoIncr(s: string): number {
const n = s.length;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 093. \346\234\200\351\225\277\346\226\220\346\263\242\351\202\243\345\245\221\346\225\260\345\210\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 093. \346\234\200\351\225\277\346\226\220\346\263\242\351\202\243\345\245\221\346\225\260\345\210\227/README.md"
index a7ad39bea1927..7bece72ba906c 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 093. \346\234\200\351\225\277\346\226\220\346\263\242\351\202\243\345\245\221\346\225\260\345\210\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 093. \346\234\200\351\225\277\346\226\220\346\263\242\351\202\243\345\245\221\346\225\260\345\210\227/README.md"
@@ -68,6 +68,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def lenLongestFibSubseq(self, arr: List[int]) -> int:
@@ -89,6 +91,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int lenLongestFibSubseq(int[] arr) {
@@ -121,6 +125,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -151,6 +157,8 @@ public:
};
```
+#### Go
+
```go
func lenLongestFibSubseq(arr []int) int {
n := len(arr)
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 094. \346\234\200\345\260\221\345\233\236\346\226\207\345\210\206\345\211\262/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 094. \346\234\200\345\260\221\345\233\236\346\226\207\345\210\206\345\211\262/README.md"
index 1308836a21c92..3147f7ba4e499 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 094. \346\234\200\345\260\221\345\233\236\346\226\207\345\210\206\345\211\262/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 094. \346\234\200\345\260\221\345\233\236\346\226\207\345\210\206\345\211\262/README.md"
@@ -80,6 +80,8 @@ $$
+#### Python3
+
```python
class Solution:
def minCut(self, s: str) -> int:
@@ -96,6 +98,8 @@ class Solution:
return f[-1]
```
+#### Java
+
```java
class Solution {
public int minCut(String s) {
@@ -125,6 +129,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -151,6 +157,8 @@ public:
};
```
+#### Go
+
```go
func minCut(s string) int {
n := len(s)
@@ -183,6 +191,8 @@ func minCut(s string) int {
}
```
+#### TypeScript
+
```ts
function minCut(s: string): number {
const n = s.length;
@@ -208,6 +218,8 @@ function minCut(s: string): number {
}
```
+#### C#
+
```cs
public class Solution {
public int MinCut(string s) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 095. \346\234\200\351\225\277\345\205\254\345\205\261\345\255\220\345\272\217\345\210\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 095. \346\234\200\351\225\277\345\205\254\345\205\261\345\255\220\345\272\217\345\210\227/README.md"
index b8ca20abfee75..eafbc0baaa62c 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 095. \346\234\200\351\225\277\345\205\254\345\205\261\345\255\220\345\272\217\345\210\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 095. \346\234\200\351\225\277\345\205\254\345\205\261\345\255\220\345\272\217\345\210\227/README.md"
@@ -84,6 +84,8 @@ $$
+#### Python3
+
```python
class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
@@ -98,6 +100,8 @@ class Solution:
return f[-1][-1]
```
+#### Java
+
```java
class Solution {
public int longestCommonSubsequence(String text1, String text2) {
@@ -117,6 +121,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -137,6 +143,8 @@ public:
};
```
+#### Go
+
```go
func longestCommonSubsequence(text1 string, text2 string) int {
m, n := len(text1), len(text2)
@@ -157,6 +165,8 @@ func longestCommonSubsequence(text1 string, text2 string) int {
}
```
+#### TypeScript
+
```ts
function longestCommonSubsequence(text1: string, text2: string): number {
const m = text1.length;
@@ -175,6 +185,8 @@ function longestCommonSubsequence(text1: string, text2: string): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn longest_common_subsequence(text1: String, text2: String) -> i32 {
@@ -195,6 +207,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} text1
@@ -218,6 +232,8 @@ var longestCommonSubsequence = function (text1, text2) {
};
```
+#### C#
+
```cs
public class Solution {
public int LongestCommonSubsequence(string text1, string text2) {
@@ -237,6 +253,8 @@ public class Solution {
}
```
+#### Kotlin
+
```kotlin
class Solution {
fun longestCommonSubsequence(text1: String, text2: String): Int {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 096. \345\255\227\347\254\246\344\270\262\344\272\244\347\273\207/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 096. \345\255\227\347\254\246\344\270\262\344\272\244\347\273\207/README.md"
index ae986736bb6e7..1bdb9ae5b776e 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 096. \345\255\227\347\254\246\344\270\262\344\272\244\347\273\207/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 096. \345\255\227\347\254\246\344\270\262\344\272\244\347\273\207/README.md"
@@ -91,6 +91,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def isInterleave(self, s1: str, s2: str, s3: str) -> bool:
@@ -111,6 +113,8 @@ class Solution:
return dfs(0, 0)
```
+#### Java
+
```java
class Solution {
private Map, Boolean> f = new HashMap<>();
@@ -154,6 +158,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -185,6 +191,8 @@ public:
};
```
+#### Go
+
```go
func isInterleave(s1 string, s2 string, s3 string) bool {
m, n := len(s1), len(s2)
@@ -209,6 +217,8 @@ func isInterleave(s1 string, s2 string, s3 string) bool {
}
```
+#### TypeScript
+
```ts
function isInterleave(s1: string, s2: string, s3: string): boolean {
const m = s1.length;
@@ -237,6 +247,8 @@ function isInterleave(s1: string, s2: string, s3: string): boolean {
}
```
+#### C#
+
```cs
public class Solution {
private int m;
@@ -308,6 +320,8 @@ $$
+#### Python3
+
```python
class Solution:
def isInterleave(self, s1: str, s2: str, s3: str) -> bool:
@@ -326,6 +340,8 @@ class Solution:
return f[m][n]
```
+#### Java
+
```java
class Solution {
public boolean isInterleave(String s1, String s2, String s3) {
@@ -351,6 +367,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -378,6 +396,8 @@ public:
};
```
+#### Go
+
```go
func isInterleave(s1 string, s2 string, s3 string) bool {
m, n := len(s1), len(s2)
@@ -404,6 +424,8 @@ func isInterleave(s1 string, s2 string, s3 string) bool {
}
```
+#### TypeScript
+
```ts
function isInterleave(s1: string, s2: string, s3: string): boolean {
const m = s1.length;
@@ -428,6 +450,8 @@ function isInterleave(s1: string, s2: string, s3: string): boolean {
}
```
+#### C#
+
```cs
public class Solution {
public bool IsInterleave(string s1, string s2, string s3) {
@@ -463,6 +487,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def isInterleave(self, s1: str, s2: str, s3: str) -> bool:
@@ -480,6 +506,8 @@ class Solution:
return f[n]
```
+#### Java
+
```java
class Solution {
public boolean isInterleave(String s1, String s2, String s3) {
@@ -505,6 +533,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -532,6 +562,8 @@ public:
};
```
+#### Go
+
```go
func isInterleave(s1 string, s2 string, s3 string) bool {
m, n := len(s1), len(s2)
@@ -555,6 +587,8 @@ func isInterleave(s1 string, s2 string, s3 string) bool {
}
```
+#### TypeScript
+
```ts
function isInterleave(s1: string, s2: string, s3: string): boolean {
const m = s1.length;
@@ -579,6 +613,8 @@ function isInterleave(s1: string, s2: string, s3: string): boolean {
}
```
+#### C#
+
```cs
public class Solution {
public bool IsInterleave(string s1, string s2, string s3) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 097. \345\255\220\345\272\217\345\210\227\347\232\204\346\225\260\347\233\256/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 097. \345\255\220\345\272\217\345\210\227\347\232\204\346\225\260\347\233\256/README.md"
index 434e795183ad7..b0d69eacdb89f 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 097. \345\255\220\345\272\217\345\210\227\347\232\204\346\225\260\347\233\256/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 097. \345\255\220\345\272\217\345\210\227\347\232\204\346\225\260\347\233\256/README.md"
@@ -91,6 +91,8 @@ $$
+#### Python3
+
```python
class Solution:
def numDistinct(self, s: str, t: str) -> int:
@@ -106,6 +108,8 @@ class Solution:
return f[m][n]
```
+#### Java
+
```java
class Solution {
public int numDistinct(String s, String t) {
@@ -127,6 +131,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -150,6 +156,8 @@ public:
};
```
+#### Go
+
```go
func numDistinct(s string, t string) int {
m, n := len(s), len(t)
@@ -172,6 +180,8 @@ func numDistinct(s string, t string) int {
}
```
+#### TypeScript
+
```ts
function numDistinct(s: string, t: string): number {
const m = s.length;
@@ -202,6 +212,8 @@ function numDistinct(s: string, t: string): number {
+#### Python3
+
```python
class Solution:
def numDistinct(self, s: str, t: str) -> int:
@@ -214,6 +226,8 @@ class Solution:
return f[n]
```
+#### Java
+
```java
class Solution {
public int numDistinct(String s, String t) {
@@ -233,6 +247,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -254,6 +270,8 @@ public:
};
```
+#### Go
+
```go
func numDistinct(s string, t string) int {
n := len(t)
@@ -270,6 +288,8 @@ func numDistinct(s string, t string) int {
}
```
+#### TypeScript
+
```ts
function numDistinct(s: string, t: string): number {
const n = t.length;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 098. \350\267\257\345\276\204\347\232\204\346\225\260\347\233\256/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 098. \350\267\257\345\276\204\347\232\204\346\225\260\347\233\256/README.md"
index 69203592532e6..805e968332fcc 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 098. \350\267\257\345\276\204\347\232\204\346\225\260\347\233\256/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 098. \350\267\257\345\276\204\347\232\204\346\225\260\347\233\256/README.md"
@@ -97,6 +97,8 @@ $$
+#### Python3
+
```python
class Solution:
def uniquePaths(self, m: int, n: int) -> int:
@@ -111,6 +113,8 @@ class Solution:
return f[-1][-1]
```
+#### Java
+
```java
class Solution {
public int uniquePaths(int m, int n) {
@@ -131,6 +135,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -152,6 +158,8 @@ public:
};
```
+#### Go
+
```go
func uniquePaths(m int, n int) int {
f := make([][]int, m)
@@ -173,6 +181,8 @@ func uniquePaths(m int, n int) int {
}
```
+#### TypeScript
+
```ts
function uniquePaths(m: number, n: number): number {
const f: number[][] = Array(m)
@@ -193,6 +203,8 @@ function uniquePaths(m: number, n: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn unique_paths(m: i32, n: i32) -> i32 {
@@ -208,6 +220,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} m
@@ -243,6 +257,8 @@ var uniquePaths = function (m, n) {
+#### Python3
+
```python
class Solution:
def uniquePaths(self, m: int, n: int) -> int:
@@ -253,6 +269,8 @@ class Solution:
return f[-1][-1]
```
+#### Java
+
```java
class Solution {
public int uniquePaths(int m, int n) {
@@ -270,6 +288,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -285,6 +305,8 @@ public:
};
```
+#### Go
+
```go
func uniquePaths(m int, n int) int {
f := make([][]int, m)
@@ -303,6 +325,8 @@ func uniquePaths(m int, n int) int {
}
```
+#### TypeScript
+
```ts
function uniquePaths(m: number, n: number): number {
const f: number[][] = Array(m)
@@ -317,6 +341,8 @@ function uniquePaths(m: number, n: number): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number} m
@@ -346,6 +372,8 @@ var uniquePaths = function (m, n) {
+#### Python3
+
```python
class Solution:
def uniquePaths(self, m: int, n: int) -> int:
@@ -356,6 +384,8 @@ class Solution:
return f[-1]
```
+#### Java
+
```java
class Solution {
public int uniquePaths(int m, int n) {
@@ -371,6 +401,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -386,6 +418,8 @@ public:
};
```
+#### Go
+
```go
func uniquePaths(m int, n int) int {
f := make([]int, n+1)
@@ -401,6 +435,8 @@ func uniquePaths(m int, n int) int {
}
```
+#### TypeScript
+
```ts
function uniquePaths(m: number, n: number): number {
const f: number[] = Array(n).fill(1);
@@ -413,6 +449,8 @@ function uniquePaths(m: number, n: number): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number} m
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 099. \346\234\200\345\260\217\350\267\257\345\276\204\344\271\213\345\222\214/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 099. \346\234\200\345\260\217\350\267\257\345\276\204\344\271\213\345\222\214/README.md"
index 61afc9d56f29b..af4b02afa7ef6 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 099. \346\234\200\345\260\217\350\267\257\345\276\204\344\271\213\345\222\214/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 099. \346\234\200\345\260\217\350\267\257\345\276\204\344\271\213\345\222\214/README.md"
@@ -59,6 +59,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def minPathSum(self, grid: List[List[int]]) -> int:
@@ -74,6 +76,8 @@ class Solution:
return dp[-1][-1]
```
+#### Java
+
```java
class Solution {
public int minPathSum(int[][] grid) {
@@ -96,6 +100,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -118,6 +124,8 @@ public:
};
```
+#### Go
+
```go
func minPathSum(grid [][]int) int {
m, n := len(grid), len(grid[0])
@@ -141,6 +149,8 @@ func minPathSum(grid [][]int) int {
}
```
+#### TypeScript
+
```ts
function minPathSum(grid: number[][]): number {
let m = grid.length,
@@ -164,6 +174,8 @@ function minPathSum(grid: number[][]): number {
}
```
+#### C#
+
```cs
public class Solution {
public int MinPathSum(int[][] grid) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 100. \344\270\211\350\247\222\345\275\242\344\270\255\346\234\200\345\260\217\350\267\257\345\276\204\344\271\213\345\222\214/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 100. \344\270\211\350\247\222\345\275\242\344\270\255\346\234\200\345\260\217\350\267\257\345\276\204\344\271\213\345\222\214/README.md"
index 62c28385d8db8..ee4cb53c0361f 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 100. \344\270\211\350\247\222\345\275\242\344\270\255\346\234\200\345\260\217\350\267\257\345\276\204\344\271\213\345\222\214/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 100. \344\270\211\350\247\222\345\275\242\344\270\255\346\234\200\345\260\217\350\267\257\345\276\204\344\271\213\345\222\214/README.md"
@@ -70,6 +70,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def minimumTotal(self, triangle: List[List[int]]) -> int:
@@ -81,6 +83,8 @@ class Solution:
return dp[0][0]
```
+#### Java
+
```java
class Solution {
@@ -97,6 +101,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -111,6 +117,8 @@ public:
};
```
+#### Go
+
```go
func minimumTotal(triangle [][]int) int {
n := len(triangle)
@@ -134,6 +142,8 @@ func minimumTotal(triangle [][]int) int {
+#### Python3
+
```python
class Solution:
def minimumTotal(self, triangle: List[List[int]]) -> int:
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 101. \345\210\206\345\211\262\347\255\211\345\222\214\345\255\220\344\270\262/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 101. \345\210\206\345\211\262\347\255\211\345\222\214\345\255\220\344\270\262/README.md"
index 88b9cc018aa36..d18ad79e1d2db 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 101. \345\210\206\345\211\262\347\255\211\345\222\214\345\255\220\344\270\262/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 101. \345\210\206\345\211\262\347\255\211\345\222\214\345\255\220\344\270\262/README.md"
@@ -55,6 +55,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def canPartition(self, nums: List[int]) -> bool:
@@ -77,6 +79,8 @@ class Solution:
return dp[-1][-1]
```
+#### Java
+
```java
class Solution {
public boolean canPartition(int[] nums) {
@@ -103,6 +107,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -124,6 +130,8 @@ public:
};
```
+#### Go
+
```go
func canPartition(nums []int) bool {
s := 0
@@ -158,6 +166,8 @@ func canPartition(nums []int) bool {
+#### Python3
+
```python
class Solution:
def canPartition(self, nums: List[int]) -> bool:
@@ -187,6 +197,8 @@ class Solution:
+#### Python3
+
```python
class Solution:
def canPartition(self, nums: List[int]) -> bool:
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 102. \345\212\240\345\207\217\347\232\204\347\233\256\346\240\207\345\200\274/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 102. \345\212\240\345\207\217\347\232\204\347\233\256\346\240\207\345\200\274/README.md"
index dc3d85944843c..8c6e72e679a66 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 102. \345\212\240\345\207\217\347\232\204\347\233\256\346\240\207\345\200\274/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 102. \345\212\240\345\207\217\347\232\204\347\233\256\346\240\207\345\200\274/README.md"
@@ -68,6 +68,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def findTargetSumWays(self, nums: List[int], target: int) -> int:
@@ -85,6 +87,8 @@ class Solution:
return dp[n - 1][target + 1000]
```
+#### Java
+
```java
class Solution {
public int findTargetSumWays(int[] nums, int target) {
@@ -111,6 +115,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -131,6 +137,8 @@ public:
};
```
+#### Go
+
```go
func findTargetSumWays(nums []int, target int) int {
if target < -1000 || target > 1000 {
@@ -165,6 +173,8 @@ func findTargetSumWays(nums []int, target int) int {
+#### Python3
+
```python
class Solution:
def findTargetSumWays(self, nums: List[int], target: int) -> int:
@@ -183,6 +193,8 @@ class Solution:
return dp[-1][-1]
```
+#### Java
+
```java
class Solution {
public int findTargetSumWays(int[] nums, int target) {
@@ -206,6 +218,8 @@ class Solution {
}
```
+#### Go
+
```go
func findTargetSumWays(nums []int, target int) int {
s := 0
@@ -237,6 +251,8 @@ func findTargetSumWays(nums []int, target int) int {
+#### Python3
+
```python
class Solution:
def findTargetSumWays(self, nums: List[int], target: int) -> int:
@@ -263,6 +279,8 @@ class Solution:
+#### Python3
+
```python
class Solution:
def findTargetSumWays(self, nums: List[int], target: int) -> int:
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 103. \346\234\200\345\260\221\347\232\204\347\241\254\345\270\201\346\225\260\347\233\256/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 103. \346\234\200\345\260\221\347\232\204\347\241\254\345\270\201\346\225\260\347\233\256/README.md"
index 1097167699d5c..96d02c1d78299 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 103. \346\234\200\345\260\221\347\232\204\347\241\254\345\270\201\346\225\260\347\233\256/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 103. \346\234\200\345\260\221\347\232\204\347\241\254\345\270\201\346\225\260\347\233\256/README.md"
@@ -75,6 +75,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def coinChange(self, coins: List[int], amount: int) -> int:
@@ -86,6 +88,8 @@ class Solution:
return -1 if dp[-1] > amount else dp[-1]
```
+#### Java
+
```java
class Solution {
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -123,6 +129,8 @@ public:
};
```
+#### Go
+
```go
func coinChange(coins []int, amount int) int {
dp := make([]int, amount+1)
@@ -141,6 +149,8 @@ func coinChange(coins []int, amount int) int {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} coins
@@ -169,6 +179,8 @@ var coinChange = function (coins, amount) {
+#### Java
+
```java
class Solution {
@@ -203,6 +215,8 @@ class Solution {
+#### Java
+
```java
class Solution {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 104. \346\216\222\345\210\227\347\232\204\346\225\260\347\233\256/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 104. \346\216\222\345\210\227\347\232\204\346\225\260\347\233\256/README.md"
index cd04be172d3b2..5bae4765fa3e0 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 104. \346\216\222\345\210\227\347\232\204\346\225\260\347\233\256/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 104. \346\216\222\345\210\227\347\232\204\346\225\260\347\233\256/README.md"
@@ -70,6 +70,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def combinationSum4(self, nums: List[int], target: int) -> int:
@@ -82,6 +84,8 @@ class Solution:
return dp[-1]
```
+#### Java
+
```java
class Solution {
@@ -100,6 +104,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -118,6 +124,8 @@ public:
};
```
+#### Go
+
```go
func combinationSum4(nums []int, target int) int {
dp := make([]int, target+1)
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 105. \345\262\233\345\261\277\347\232\204\346\234\200\345\244\247\351\235\242\347\247\257/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 105. \345\262\233\345\261\277\347\232\204\346\234\200\345\244\247\351\235\242\347\247\257/README.md"
index 38a8c41351fa4..fec092604a769 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 105. \345\262\233\345\261\277\347\232\204\346\234\200\345\244\247\351\235\242\347\247\257/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 105. \345\262\233\345\261\277\347\232\204\346\234\200\345\244\247\351\235\242\347\247\257/README.md"
@@ -63,6 +63,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def maxAreaOfIsland(self, grid: List[List[int]]) -> int:
@@ -82,6 +84,8 @@ class Solution:
return max(dfs(i, j) for i in range(m) for j in range(n))
```
+#### Java
+
```java
class Solution {
private int m;
@@ -119,6 +123,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -150,6 +156,8 @@ public:
};
```
+#### Go
+
```go
func maxAreaOfIsland(grid [][]int) (ans int) {
m, n := len(grid), len(grid[0])
@@ -178,6 +186,8 @@ func maxAreaOfIsland(grid [][]int) (ans int) {
}
```
+#### TypeScript
+
```ts
function maxAreaOfIsland(grid: number[][]): number {
const m = grid.length;
@@ -207,6 +217,8 @@ function maxAreaOfIsland(grid: number[][]): number {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(grid: &mut Vec>, i: usize, j: usize) -> i32 {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 106. \344\272\214\345\210\206\345\233\276/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 106. \344\272\214\345\210\206\345\233\276/README.md"
index 5ecbacd4960a4..710a738b34294 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 106. \344\272\214\345\210\206\345\233\276/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 106. \344\272\214\345\210\206\345\233\276/README.md"
@@ -74,6 +74,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def isBipartite(self, graph: List[List[int]]) -> bool:
@@ -92,6 +94,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
private int[] p;
@@ -123,6 +127,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -149,6 +155,8 @@ public:
};
```
+#### Go
+
```go
func isBipartite(graph [][]int) bool {
n := len(graph)
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 107. \347\237\251\351\230\265\344\270\255\347\232\204\350\267\235\347\246\273/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 107. \347\237\251\351\230\265\344\270\255\347\232\204\350\267\235\347\246\273/README.md"
index c8ddc11b0e445..7a1840e9e959b 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 107. \347\237\251\351\230\265\344\270\255\347\232\204\350\267\235\347\246\273/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 107. \347\237\251\351\230\265\344\270\255\347\232\204\350\267\235\347\246\273/README.md"
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def updateMatrix(self, mat: List[List[int]]) -> List[List[int]]:
@@ -88,6 +90,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
@@ -123,6 +127,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -156,6 +162,8 @@ public:
};
```
+#### Go
+
```go
func updateMatrix(mat [][]int) [][]int {
m, n := len(mat), len(mat[0])
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 108. \345\215\225\350\257\215\346\274\224\345\217\230/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 108. \345\215\225\350\257\215\346\274\224\345\217\230/README.md"
index 8b320229bc0b9..12309e85a5a3a 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 108. \345\215\225\350\257\215\346\274\224\345\217\230/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 108. \345\215\225\350\257\215\346\274\224\345\217\230/README.md"
@@ -67,6 +67,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def ladderLength(self, beginWord: str, endWord: str, wordList: List[str]) -> int:
@@ -94,6 +96,8 @@ class Solution:
return 0
```
+#### Java
+
```java
class Solution {
@@ -130,6 +134,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -160,6 +166,8 @@ public:
};
```
+#### Go
+
```go
func ladderLength(beginWord string, endWord string, wordList []string) int {
words := make(map[string]bool)
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 109. \345\274\200\345\257\206\347\240\201\351\224\201/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 109. \345\274\200\345\257\206\347\240\201\351\224\201/README.md"
index fbc3a580f7674..906d152fed407 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 109. \345\274\200\345\257\206\347\240\201\351\224\201/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 109. \345\274\200\345\257\206\347\240\201\351\224\201/README.md"
@@ -82,6 +82,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def openLock(self, deadends: List[str], target: str) -> int:
@@ -123,6 +125,8 @@ class Solution:
return -1
```
+#### Java
+
```java
class Solution {
public int openLock(String[] deadends, String target) {
@@ -180,6 +184,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 110. \346\211\200\346\234\211\350\267\257\345\276\204/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 110. \346\211\200\346\234\211\350\267\257\345\276\204/README.md"
index b0a70178165b8..d836612be9356 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 110. \346\211\200\346\234\211\350\267\257\345\276\204/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 110. \346\211\200\346\234\211\350\267\257\345\276\204/README.md"
@@ -83,6 +83,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def allPathsSourceTarget(self, graph: List[List[int]]) -> List[List[int]]:
@@ -101,6 +103,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans;
@@ -129,6 +133,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -157,6 +163,8 @@ public:
};
```
+#### Go
+
```go
func allPathsSourceTarget(graph [][]int) [][]int {
var path []int
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 111. \350\256\241\347\256\227\351\231\244\346\263\225/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 111. \350\256\241\347\256\227\351\231\244\346\263\225/README.md"
index b8f702e43dcdd..50e3b501799b6 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 111. \350\256\241\347\256\227\351\231\244\346\263\225/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 111. \350\256\241\347\256\227\351\231\244\346\263\225/README.md"
@@ -76,6 +76,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def calcEquation(
@@ -119,6 +121,8 @@ class Solution:
return res
```
+#### Java
+
```java
class Solution {
private int[] p;
@@ -177,6 +181,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -226,6 +232,8 @@ public:
};
```
+#### Go
+
```go
var p []int
var w []float64
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 112. \346\234\200\351\225\277\351\200\222\345\242\236\350\267\257\345\276\204/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 112. \346\234\200\351\225\277\351\200\222\345\242\236\350\267\257\345\276\204/README.md"
index 435673cd13f5c..4e8337208369c 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 112. \346\234\200\351\225\277\351\200\222\345\242\236\350\267\257\345\276\204/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 112. \346\234\200\351\225\277\351\200\222\345\242\236\350\267\257\345\276\204/README.md"
@@ -68,6 +68,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def longestIncreasingPath(self, matrix: List[List[int]]) -> int:
@@ -84,6 +86,8 @@ class Solution:
return max(dfs(i, j) for i in range(m) for j in range(n))
```
+#### Java
+
```java
class Solution {
private int[][] memo;
@@ -126,6 +130,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -161,6 +167,8 @@ public:
};
```
+#### Go
+
```go
func longestIncreasingPath(matrix [][]int) int {
m, n := len(matrix), len(matrix[0])
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 113. \350\257\276\347\250\213\351\241\272\345\272\217/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 113. \350\257\276\347\250\213\351\241\272\345\272\217/README.md"
index 13672407bb94a..52e72ae62a670 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 113. \350\257\276\347\250\213\351\241\272\345\272\217/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 113. \350\257\276\347\250\213\351\241\272\345\272\217/README.md"
@@ -79,6 +79,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def findOrder(self, numCourses: int, prerequisites: List[List[int]]) -> List[int]:
@@ -99,6 +101,8 @@ class Solution:
return ans if len(ans) == numCourses else []
```
+#### Java
+
```java
class Solution {
public int[] findOrder(int numCourses, int[][] prerequisites) {
@@ -132,6 +136,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -165,6 +171,8 @@ public:
};
```
+#### Go
+
```go
func findOrder(numCourses int, prerequisites [][]int) []int {
g := make([][]int, numCourses)
@@ -199,6 +207,8 @@ func findOrder(numCourses int, prerequisites [][]int) []int {
}
```
+#### TypeScript
+
```ts
function findOrder(numCourses: number, prerequisites: number[][]): number[] {
const g: number[][] = Array.from({ length: numCourses }, () => []);
@@ -222,6 +232,8 @@ function findOrder(numCourses: number, prerequisites: number[][]): number[] {
}
```
+#### C#
+
```cs
public class Solution {
public int[] FindOrder(int numCourses, int[][] prerequisites) {
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 114. \345\244\226\346\230\237\346\226\207\345\255\227\345\205\270/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 114. \345\244\226\346\230\237\346\226\207\345\255\227\345\205\270/README.md"
index af323f954e8af..157afc94e0ee0 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 114. \345\244\226\346\230\237\346\226\207\345\255\227\345\205\270/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 114. \345\244\226\346\230\237\346\226\207\345\255\227\345\205\270/README.md"
@@ -89,6 +89,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def alienOrder(self, words: List[str]) -> str:
@@ -145,6 +147,8 @@ class Solution:
return '' if len(ans) < cnt else ''.join(ans)
```
+#### Java
+
```java
class Solution {
@@ -222,6 +226,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 115. \351\207\215\345\273\272\345\272\217\345\210\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 115. \351\207\215\345\273\272\345\272\217\345\210\227/README.md"
index 41b9e16f4c1e2..3f1b34527a0af 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 115. \351\207\215\345\273\272\345\272\217\345\210\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 115. \351\207\215\345\273\272\345\272\217\345\210\227/README.md"
@@ -92,6 +92,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def sequenceReconstruction(
@@ -115,6 +117,8 @@ class Solution:
return len(q) == 0
```
+#### Java
+
```java
class Solution {
public boolean sequenceReconstruction(int[] nums, List> sequences) {
@@ -148,6 +152,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -182,6 +188,8 @@ public:
};
```
+#### Go
+
```go
func sequenceReconstruction(nums []int, sequences [][]int) bool {
n := len(nums)
@@ -215,6 +223,8 @@ func sequenceReconstruction(nums []int, sequences [][]int) bool {
}
```
+#### TypeScript
+
```ts
function sequenceReconstruction(nums: number[], sequences: number[][]): boolean {
const n = nums.length;
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 116. \346\234\213\345\217\213\345\234\210/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 116. \346\234\213\345\217\213\345\234\210/README.md"
index af6e9f665bc9f..cdf70fee2963e 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 116. \346\234\213\345\217\213\345\234\210/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 116. \346\234\213\345\217\213\345\234\210/README.md"
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def findCircleNum(self, isConnected: List[List[int]]) -> int:
@@ -85,6 +87,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private int[][] isConnected;
@@ -116,6 +120,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -146,6 +152,8 @@ public:
};
```
+#### Go
+
```go
func findCircleNum(isConnected [][]int) int {
n := len(isConnected)
@@ -243,6 +251,8 @@ d[find(a)] = distance
+#### Python3
+
```python
class Solution:
def findCircleNum(self, isConnected: List[List[int]]) -> int:
@@ -260,6 +270,8 @@ class Solution:
return sum(i == v for i, v in enumerate(p))
```
+#### Java
+
```java
class Solution {
private int[] p;
@@ -295,6 +307,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -322,6 +336,8 @@ public:
};
```
+#### Go
+
```go
func findCircleNum(isConnected [][]int) int {
n := len(isConnected)
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 117. \347\233\270\344\274\274\347\232\204\345\255\227\347\254\246\344\270\262/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 117. \347\233\270\344\274\274\347\232\204\345\255\227\347\254\246\344\270\262/README.md"
index 7010bb325419c..fb2874e52e8d9 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 117. \347\233\270\344\274\274\347\232\204\345\255\227\347\254\246\344\270\262/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 117. \347\233\270\344\274\274\347\232\204\345\255\227\347\254\246\344\270\262/README.md"
@@ -62,6 +62,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def numSimilarGroups(self, strs: List[str]) -> int:
@@ -79,6 +81,8 @@ class Solution:
return sum(i == find(i) for i in range(n))
```
+#### Java
+
```java
class Solution {
private int[] p;
@@ -125,6 +129,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -160,6 +166,8 @@ public:
};
```
+#### Go
+
```go
func numSimilarGroups(strs []string) int {
n := len(strs)
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 118. \345\244\232\344\275\231\347\232\204\350\276\271/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 118. \345\244\232\344\275\231\347\232\204\350\276\271/README.md"
index e036ffeaff735..b9dda603f6065 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 118. \345\244\232\344\275\231\347\232\204\350\276\271/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 118. \345\244\232\344\275\231\347\232\204\350\276\271/README.md"
@@ -65,6 +65,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def findRedundantConnection(self, edges: List[List[int]]) -> List[int]:
@@ -81,6 +83,8 @@ class Solution:
return []
```
+#### Java
+
```java
class Solution {
private int[] p;
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -132,6 +138,8 @@ public:
};
```
+#### Go
+
```go
func findRedundantConnection(edges [][]int) []int {
p := make([]int, 1010)
diff --git "a/lcof2/\345\211\221\346\214\207 Offer II 119. \346\234\200\351\225\277\350\277\236\347\273\255\345\272\217\345\210\227/README.md" "b/lcof2/\345\211\221\346\214\207 Offer II 119. \346\234\200\351\225\277\350\277\236\347\273\255\345\272\217\345\210\227/README.md"
index b8b61920c8923..c38278c1a11ec 100644
--- "a/lcof2/\345\211\221\346\214\207 Offer II 119. \346\234\200\351\225\277\350\277\236\347\273\255\345\272\217\345\210\227/README.md"
+++ "b/lcof2/\345\211\221\346\214\207 Offer II 119. \346\234\200\351\225\277\350\277\236\347\273\255\345\272\217\345\210\227/README.md"
@@ -68,6 +68,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcof2/%E5%89%91%E6%8C%87%2
+#### Python3
+
```python
class Solution:
def longestConsecutive(self, nums: List[int]) -> int:
@@ -87,6 +89,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int longestConsecutive(int[] nums) {
@@ -111,6 +115,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
func longestConsecutive(nums []int) int {
n := len(nums)
@@ -159,6 +167,8 @@ func longestConsecutive(nums []int) int {
}
```
+#### TypeScript
+
```ts
function longestConsecutive(nums: number[]): number {
const n = nums.length;
@@ -182,6 +192,8 @@ function longestConsecutive(nums: number[]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -223,6 +235,8 @@ var longestConsecutive = function (nums) {
+#### Python3
+
```python
class Solution:
def longestConsecutive(self, nums: List[int]) -> int:
@@ -237,6 +251,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int longestConsecutive(int[] nums) {
@@ -259,6 +275,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -279,6 +297,8 @@ public:
};
```
+#### Go
+
```go
func longestConsecutive(nums []int) (ans int) {
s := map[int]bool{}
@@ -298,6 +318,8 @@ func longestConsecutive(nums []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function longestConsecutive(nums: number[]): number {
const s: Set = new Set(nums);
@@ -315,6 +337,8 @@ function longestConsecutive(nums: number[]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
diff --git "a/lcp/LCP 01. \347\214\234\346\225\260\345\255\227/README.md" "b/lcp/LCP 01. \347\214\234\346\225\260\345\255\227/README.md"
index 814015f188506..27eaab2822b7b 100644
--- "a/lcp/LCP 01. \347\214\234\346\225\260\345\255\227/README.md"
+++ "b/lcp/LCP 01. \347\214\234\346\225\260\345\255\227/README.md"
@@ -56,12 +56,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2001.%20%E7%8C%9C%
+#### Python3
+
```python
class Solution:
def game(self, guess: List[int], answer: List[int]) -> int:
return sum(a == b for a, b in zip(guess, answer))
```
+#### Java
+
```java
class Solution {
public int game(int[] guess, int[] answer) {
@@ -76,6 +80,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -89,6 +95,8 @@ public:
};
```
+#### Go
+
```go
func game(guess []int, answer []int) (ans int) {
for i, a := range guess {
@@ -100,6 +108,8 @@ func game(guess []int, answer []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function game(guess: number[], answer: number[]): number {
let ans = 0;
@@ -112,6 +122,8 @@ function game(guess: number[], answer: number[]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} guess
@@ -129,6 +141,8 @@ var game = function (guess, answer) {
};
```
+#### C
+
```c
int game(int* guess, int guessSize, int* answer, int answerSize) {
int res = 0;
@@ -151,6 +165,8 @@ int game(int* guess, int guessSize, int* answer, int answerSize) {
+#### TypeScript
+
```ts
function game(guess: number[], answer: number[]): number {
return guess.reduce((acc, cur, index) => (cur === answer[index] ? acc + 1 : acc), 0);
diff --git "a/lcp/LCP 02. \345\210\206\345\274\217\345\214\226\347\256\200/README.md" "b/lcp/LCP 02. \345\210\206\345\274\217\345\214\226\347\256\200/README.md"
index 980d6db32921a..f2c5e01372cdd 100644
--- "a/lcp/LCP 02. \345\210\206\345\274\217\345\214\226\347\256\200/README.md"
+++ "b/lcp/LCP 02. \345\210\206\345\274\217\345\214\226\347\256\200/README.md"
@@ -68,6 +68,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2002.%20%E5%88%86%
+#### Python3
+
```python
class Solution:
def fraction(self, cont: List[int]) -> List[int]:
@@ -82,6 +84,8 @@ class Solution:
return dfs(0)
```
+#### Java
+
```java
class Solution {
private int[] cont;
@@ -108,6 +112,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -128,6 +134,8 @@ public:
};
```
+#### Go
+
```go
func fraction(cont []int) []int {
var dfs func(i int) []int
@@ -143,6 +151,8 @@ func fraction(cont []int) []int {
}
```
+#### TypeScript
+
```ts
function fraction(cont: number[]): number[] {
const dfs = (i: number): number[] => {
@@ -161,6 +171,8 @@ function fraction(cont: number[]): number[] {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} cont
diff --git "a/lcp/LCP 03. \346\234\272\345\231\250\344\272\272\345\244\247\345\206\222\351\231\251/README.md" "b/lcp/LCP 03. \346\234\272\345\231\250\344\272\272\345\244\247\345\206\222\351\231\251/README.md"
index d65630f8e226a..c086edd1b0eb7 100644
--- "a/lcp/LCP 03. \346\234\272\345\231\250\344\272\272\345\244\247\345\206\222\351\231\251/README.md"
+++ "b/lcp/LCP 03. \346\234\272\345\231\250\344\272\272\345\244\247\345\206\222\351\231\251/README.md"
@@ -76,6 +76,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2003.%20%E6%9C%BA%
+#### Python3
+
```python
class Solution:
def robot(self, command: str, obstacles: List[List[int]], x: int, y: int) -> bool:
@@ -100,6 +102,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
public boolean robot(String command, int[][] obstacles, int x, int y) {
@@ -132,6 +136,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -165,6 +171,8 @@ public:
};
```
+#### Go
+
```go
func robot(command string, obstacles [][]int, x int, y int) bool {
type pair struct{ i, j int }
@@ -196,6 +204,8 @@ func robot(command string, obstacles [][]int, x int, y int) bool {
}
```
+#### TypeScript
+
```ts
function robot(command: string, obstacles: number[][], x: number, y: number): boolean {
const f = (i: number, j: number): number => {
diff --git "a/lcp/LCP 05. \345\217\221 LeetCoin/README.md" "b/lcp/LCP 05. \345\217\221 LeetCoin/README.md"
index e0b1dc50a34ea..6402769f54b27 100644
--- "a/lcp/LCP 05. \345\217\221 LeetCoin/README.md"
+++ "b/lcp/LCP 05. \345\217\221 LeetCoin/README.md"
@@ -92,6 +92,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2005.%20%E5%8F%91%
+#### Python3
+
```python
MOD = int(1e9 + 7)
@@ -191,6 +193,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Node {
Node left;
@@ -325,6 +329,8 @@ class Solution {
}
```
+#### C++
+
```cpp
const int MOD = 1e9 + 7;
diff --git "a/lcp/LCP 06. \346\213\277\347\241\254\345\270\201/README.md" "b/lcp/LCP 06. \346\213\277\347\241\254\345\270\201/README.md"
index 41a12cda92634..dcd19d4422cf1 100644
--- "a/lcp/LCP 06. \346\213\277\347\241\254\345\270\201/README.md"
+++ "b/lcp/LCP 06. \346\213\277\347\241\254\345\270\201/README.md"
@@ -54,12 +54,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2006.%20%E6%8B%BF%
+#### Python3
+
```python
class Solution:
def minCount(self, coins: List[int]) -> int:
return sum((x + 1) >> 1 for x in coins)
```
+#### Java
+
```java
class Solution {
public int minCount(int[] coins) {
@@ -72,6 +76,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -85,6 +91,8 @@ public:
};
```
+#### Go
+
```go
func minCount(coins []int) (ans int) {
for _, x := range coins {
@@ -94,6 +102,8 @@ func minCount(coins []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function minCount(coins: number[]): number {
let ans = 0;
@@ -104,6 +114,8 @@ function minCount(coins: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn min_count(coins: Vec) -> i32 {
@@ -115,6 +127,8 @@ impl Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -131,6 +145,8 @@ class Solution {
}
```
+#### C
+
```c
int minCount(int* coins, int coinsSize) {
int ans = 0;
diff --git "a/lcp/LCP 07. \344\274\240\351\200\222\344\277\241\346\201\257/README.md" "b/lcp/LCP 07. \344\274\240\351\200\222\344\277\241\346\201\257/README.md"
index e461f83cd90ee..1703fe246c239 100644
--- "a/lcp/LCP 07. \344\274\240\351\200\222\344\277\241\346\201\257/README.md"
+++ "b/lcp/LCP 07. \344\274\240\351\200\222\344\277\241\346\201\257/README.md"
@@ -70,6 +70,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2007.%20%E4%BC%A0%
+#### Python3
+
```python
class Solution:
def numWays(self, n: int, relation: List[List[int]], k: int) -> int:
@@ -81,6 +83,8 @@ class Solution:
return f[-1][-1]
```
+#### Java
+
```java
class Solution {
public int numWays(int n, int[][] relation, int k) {
@@ -97,6 +101,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -115,6 +121,8 @@ public:
};
```
+#### Go
+
```go
func numWays(n int, relation [][]int, k int) int {
f := make([][]int, k+1)
@@ -132,6 +140,8 @@ func numWays(n int, relation [][]int, k int) int {
}
```
+#### TypeScript
+
```ts
function numWays(n: number, relation: number[][], k: number): number {
const f: number[][] = Array.from({ length: k + 1 }, () => Array(n).fill(0));
@@ -155,6 +165,8 @@ function numWays(n: number, relation: number[][], k: number): number {
+#### Python3
+
```python
class Solution:
def numWays(self, n: int, relation: List[List[int]], k: int) -> int:
@@ -167,6 +179,8 @@ class Solution:
return f[-1]
```
+#### Java
+
```java
class Solution {
public int numWays(int n, int[][] relation, int k) {
@@ -185,6 +199,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -204,6 +220,8 @@ public:
};
```
+#### Go
+
```go
func numWays(n int, relation [][]int, k int) int {
f := make([]int, n)
@@ -220,6 +238,8 @@ func numWays(n int, relation [][]int, k int) int {
}
```
+#### TypeScript
+
```ts
function numWays(n: number, relation: number[][], k: number): number {
let f: number[] = new Array(n).fill(0);
diff --git "a/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/README.md" "b/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/README.md"
index b414704cd393c..7f3a754caf57c 100644
--- "a/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/README.md"
+++ "b/lcp/LCP 08. \345\211\247\346\203\205\350\247\246\345\217\221\346\227\266\351\227\264/README.md"
@@ -74,6 +74,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2008.%20%E5%89%A7%
+#### Python3
+
```python
class Solution:
def getTriggerTime(
@@ -97,6 +99,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[] getTriggerTime(int[][] increase, int[][] requirements) {
diff --git "a/lcp/LCP 09. \346\234\200\345\260\217\350\267\263\350\267\203\346\254\241\346\225\260/README.md" "b/lcp/LCP 09. \346\234\200\345\260\217\350\267\263\350\267\203\346\254\241\346\225\260/README.md"
index 5c4fa1e7887bb..570853993406f 100644
--- "a/lcp/LCP 09. \346\234\200\345\260\217\350\267\263\350\267\203\346\254\241\346\225\260/README.md"
+++ "b/lcp/LCP 09. \346\234\200\345\260\217\350\267\263\350\267\203\346\254\241\346\225\260/README.md"
@@ -42,6 +42,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2009.%20%E6%9C%80%
+#### Python3
+
```python
class Solution:
def minJump(self, jump: List[int]) -> int:
@@ -65,6 +67,8 @@ class Solution:
return -1
```
+#### Java
+
```java
class Solution {
public int minJump(int[] jump) {
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -135,6 +141,8 @@ public:
};
```
+#### Go
+
```go
func minJump(jump []int) int {
n := len(jump)
diff --git "a/lcp/LCP 10. \344\272\214\345\217\211\346\240\221\344\273\273\345\212\241\350\260\203\345\272\246/README.md" "b/lcp/LCP 10. \344\272\214\345\217\211\346\240\221\344\273\273\345\212\241\350\260\203\345\272\246/README.md"
index 7642df32f9101..217b12783b14e 100644
--- "a/lcp/LCP 10. \344\272\214\345\217\211\346\240\221\344\273\273\345\212\241\350\260\203\345\272\246/README.md"
+++ "b/lcp/LCP 10. \344\272\214\345\217\211\346\240\221\344\273\273\345\212\241\350\260\203\345\272\246/README.md"
@@ -68,6 +68,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2010.%20%E4%BA%8C%
+#### Python3
+
```python
class Solution:
def minimalExecTime(self, root: TreeNode) -> float:
@@ -81,6 +83,8 @@ class Solution:
return dfs(root)[1]
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -138,6 +144,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -164,6 +172,8 @@ func minimalExecTime(root *TreeNode) float64 {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
diff --git "a/lcp/LCP 11. \346\234\237\346\234\233\344\270\252\346\225\260\347\273\237\350\256\241/README.md" "b/lcp/LCP 11. \346\234\237\346\234\233\344\270\252\346\225\260\347\273\237\350\256\241/README.md"
index 06fcb0bdcd9ea..e9159c998fec7 100644
--- "a/lcp/LCP 11. \346\234\237\346\234\233\344\270\252\346\225\260\347\273\237\350\256\241/README.md"
+++ "b/lcp/LCP 11. \346\234\237\346\234\233\344\270\252\346\225\260\347\273\237\350\256\241/README.md"
@@ -70,12 +70,16 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2011.%20%E6%9C%9F%
+#### Python3
+
```python
class Solution:
def expectNumber(self, scores: List[int]) -> int:
return len(set(scores))
```
+#### Java
+
```java
class Solution {
public int expectNumber(int[] scores) {
@@ -88,6 +92,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -98,6 +104,8 @@ public:
};
```
+#### Go
+
```go
func expectNumber(scores []int) int {
s := map[int]struct{}{}
@@ -108,6 +116,8 @@ func expectNumber(scores []int) int {
}
```
+#### TypeScript
+
```ts
function expectNumber(scores: number[]): number {
const s: Set = new Set(scores);
diff --git "a/lcp/LCP 12. \345\260\217\345\274\240\345\210\267\351\242\230\350\256\241\345\210\222/README.md" "b/lcp/LCP 12. \345\260\217\345\274\240\345\210\267\351\242\230\350\256\241\345\210\222/README.md"
index 25a3c4e3b7c9f..42804b7024b0b 100644
--- "a/lcp/LCP 12. \345\260\217\345\274\240\345\210\267\351\242\230\350\256\241\345\210\222/README.md"
+++ "b/lcp/LCP 12. \345\260\217\345\274\240\345\210\267\351\242\230\350\256\241\345\210\222/README.md"
@@ -67,6 +67,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2012.%20%E5%B0%8F%
+#### Python3
+
```python
class Solution:
def minTime(self, time: List[int], m: int) -> int:
@@ -84,6 +86,8 @@ class Solution:
return bisect_left(range(sum(time)), True, key=check)
```
+#### Java
+
```java
class Solution {
public int minTime(int[] time, int m) {
@@ -119,6 +123,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -154,6 +160,8 @@ public:
};
```
+#### Go
+
```go
func minTime(time []int, m int) int {
right := 0
@@ -176,6 +184,8 @@ func minTime(time []int, m int) int {
}
```
+#### TypeScript
+
```ts
function minTime(time: number[], m: number): number {
let left = 0;
diff --git "a/lcp/LCP 17. \351\200\237\347\256\227\346\234\272\345\231\250\344\272\272/README.md" "b/lcp/LCP 17. \351\200\237\347\256\227\346\234\272\345\231\250\344\272\272/README.md"
index 5237ead43d7e7..ef691e227f58a 100644
--- "a/lcp/LCP 17. \351\200\237\347\256\227\346\234\272\345\231\250\344\272\272/README.md"
+++ "b/lcp/LCP 17. \351\200\237\347\256\227\346\234\272\345\231\250\344\272\272/README.md"
@@ -52,6 +52,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2017.%20%E9%80%9F%
+#### Python3
+
```python
class Solution:
def calculate(self, s: str) -> int:
@@ -64,6 +66,8 @@ class Solution:
return x + y
```
+#### Java
+
```java
class Solution {
public int calculate(String s) {
@@ -80,6 +84,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -96,6 +102,8 @@ public:
};
```
+#### Go
+
```go
func calculate(s string) int {
x, y := 1, 0
diff --git "a/lcp/LCP 18. \346\227\251\351\244\220\347\273\204\345\220\210/README.md" "b/lcp/LCP 18. \346\227\251\351\244\220\347\273\204\345\220\210/README.md"
index 9858be332e87e..c04eb85dcb523 100644
--- "a/lcp/LCP 18. \346\227\251\351\244\220\347\273\204\345\220\210/README.md"
+++ "b/lcp/LCP 18. \346\227\251\351\244\220\347\273\204\345\220\210/README.md"
@@ -87,6 +87,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2018.%20%E6%97%A9%
+#### Python3
+
```python
class Solution:
def breakfastNumber(self, staple: List[int], drinks: List[int], x: int) -> int:
@@ -106,6 +108,8 @@ class Solution:
return res
```
+#### Java
+
```java
class Solution {
public int breakfastNumber(int[] staple, int[] drinks, int x) {
@@ -131,6 +135,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -156,6 +162,8 @@ public:
};
```
+#### Go
+
```go
func breakfastNumber(staple []int, drinks []int, x int) int {
res, n := 0, len(drinks)
diff --git "a/lcp/LCP 19. \347\247\213\345\217\266\346\224\266\350\227\217\351\233\206/README.md" "b/lcp/LCP 19. \347\247\213\345\217\266\346\224\266\350\227\217\351\233\206/README.md"
index 20601fa6621b4..5caceb7fe92ad 100644
--- "a/lcp/LCP 19. \347\247\213\345\217\266\346\224\266\350\227\217\351\233\206/README.md"
+++ "b/lcp/LCP 19. \347\247\213\345\217\266\346\224\266\350\227\217\351\233\206/README.md"
@@ -73,6 +73,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2019.%20%E7%A7%8B%
+#### Python3
+
```python
class Solution:
def minimumOperations(self, leaves: str) -> int:
@@ -91,6 +93,8 @@ class Solution:
return f[n - 1][2]
```
+#### Java
+
```java
class Solution {
public int minimumOperations(String leaves) {
@@ -117,6 +121,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -141,6 +147,8 @@ public:
};
```
+#### Go
+
```go
func minimumOperations(leaves string) int {
n := len(leaves)
@@ -169,6 +177,8 @@ func minimumOperations(leaves string) int {
}
```
+#### TypeScript
+
```ts
function minimumOperations(leaves: string): number {
const n = leaves.length;
diff --git "a/lcp/LCP 22. \351\273\221\347\231\275\346\226\271\346\240\274\347\224\273/README.md" "b/lcp/LCP 22. \351\273\221\347\231\275\346\226\271\346\240\274\347\224\273/README.md"
index 31bebc35fab79..92ac9d2fb7720 100644
--- "a/lcp/LCP 22. \351\273\221\347\231\275\346\226\271\346\240\274\347\224\273/README.md"
+++ "b/lcp/LCP 22. \351\273\221\347\231\275\346\226\271\346\240\274\347\224\273/README.md"
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2022.%20%E9%BB%91%
+#### Python3
+
```python
class Solution:
def paintingPlan(self, n: int, k: int) -> int:
@@ -79,6 +81,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int paintingPlan(int n, int k) {
@@ -105,6 +109,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -133,6 +139,8 @@ public:
};
```
+#### Go
+
```go
func paintingPlan(n int, k int) (ans int) {
if k == n*n {
@@ -159,6 +167,8 @@ func paintingPlan(n int, k int) (ans int) {
}
```
+#### TypeScript
+
```ts
function paintingPlan(n: number, k: number): number {
if (k === n * n) {
diff --git "a/lcp/LCP 24. \346\225\260\345\255\227\346\270\270\346\210\217/README.md" "b/lcp/LCP 24. \346\225\260\345\255\227\346\270\270\346\210\217/README.md"
index a33cd2e8a44a2..d6f58bdfd0998 100644
--- "a/lcp/LCP 24. \346\225\260\345\255\227\346\270\270\346\210\217/README.md"
+++ "b/lcp/LCP 24. \346\225\260\345\255\227\346\270\270\346\210\217/README.md"
@@ -84,6 +84,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2024.%20%E6%95%B0%
+#### Python3
+
```python
class MedianFinder:
def __init__(self):
@@ -126,6 +128,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class MedianFinder {
private PriorityQueue q1 = new PriorityQueue<>();
@@ -179,6 +183,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class MedianFinder {
public:
@@ -237,6 +243,8 @@ public:
};
```
+#### Go
+
```go
func numsGame(nums []int) []int {
n := len(nums)
diff --git "a/lcp/LCP 28. \351\207\207\350\264\255\346\226\271\346\241\210/README.md" "b/lcp/LCP 28. \351\207\207\350\264\255\346\226\271\346\241\210/README.md"
index 9c2da20c3d949..db74c352935f0 100644
--- "a/lcp/LCP 28. \351\207\207\350\264\255\346\226\271\346\241\210/README.md"
+++ "b/lcp/LCP 28. \351\207\207\350\264\255\346\226\271\346\241\210/README.md"
@@ -50,6 +50,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2028.%20%E9%87%87%
+#### Python3
+
```python
class Solution:
def purchasePlans(self, nums: List[int], target: int) -> int:
@@ -65,6 +67,8 @@ class Solution:
return res % 1000000007
```
+#### Java
+
```java
class Solution {
public int purchasePlans(int[] nums, int target) {
@@ -83,6 +87,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -99,6 +105,8 @@ public:
};
```
+#### Go
+
```go
func purchasePlans(nums []int, target int) int {
sort.Ints(nums)
diff --git "a/lcp/LCP 30. \351\255\224\345\241\224\346\270\270\346\210\217/README.md" "b/lcp/LCP 30. \351\255\224\345\241\224\346\270\270\346\210\217/README.md"
index 1da770f92f58f..7a006c4e338b3 100644
--- "a/lcp/LCP 30. \351\255\224\345\241\224\346\270\270\346\210\217/README.md"
+++ "b/lcp/LCP 30. \351\255\224\345\241\224\346\270\270\346\210\217/README.md"
@@ -60,6 +60,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2030.%20%E9%AD%94%
+#### Python3
+
```python
class Solution:
def magicTower(self, nums: List[int]) -> int:
@@ -78,6 +80,8 @@ class Solution:
return -1 if blood <= 0 else ans
```
+#### Java
+
```java
class Solution {
public int magicTower(int[] nums) {
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
func magicTower(nums []int) (ans int) {
q := hp{}
@@ -160,6 +168,8 @@ func (h *hp) Pop() any {
}
```
+#### TypeScript
+
```ts
function magicTower(nums: number[]): number {
const q = new MinPriorityQueue();
diff --git "a/lcp/LCP 33. \350\223\204\346\260\264/README.md" "b/lcp/LCP 33. \350\223\204\346\260\264/README.md"
index ed4bae2af19a5..6511af87a08b2 100644
--- "a/lcp/LCP 33. \350\223\204\346\260\264/README.md"
+++ "b/lcp/LCP 33. \350\223\204\346\260\264/README.md"
@@ -65,6 +65,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2033.%20%E8%93%84%
+#### Python3
+
```python
class Solution:
def storeWater(self, bucket: List[int], vat: List[int]) -> int:
@@ -78,6 +80,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int storeWater(int[] bucket, int[] vat) {
@@ -99,6 +103,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -121,6 +127,8 @@ public:
};
```
+#### Go
+
```go
func storeWater(bucket []int, vat []int) int {
mx := slices.Max(vat)
@@ -139,6 +147,8 @@ func storeWater(bucket []int, vat []int) int {
}
```
+#### TypeScript
+
```ts
function storeWater(bucket: number[], vat: number[]): number {
const mx = Math.max(...vat);
diff --git "a/lcp/LCP 34. \344\272\214\345\217\211\346\240\221\346\237\223\350\211\262/README.md" "b/lcp/LCP 34. \344\272\214\345\217\211\346\240\221\346\237\223\350\211\262/README.md"
index 129666862b3c5..a4c75c656f380 100644
--- "a/lcp/LCP 34. \344\272\214\345\217\211\346\240\221\346\237\223\350\211\262/README.md"
+++ "b/lcp/LCP 34. \344\272\214\345\217\211\346\240\221\346\237\223\350\211\262/README.md"
@@ -57,6 +57,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2034.%20%E4%BA%8C%
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -82,6 +84,8 @@ class Solution:
return max(dfs(root))
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -152,6 +158,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -182,6 +190,8 @@ func maxValue(root *TreeNode, k int) int {
}
```
+#### JavaScript
+
```js
/**
* Definition for a binary tree node.
diff --git "a/lcp/LCP 39. \346\227\240\344\272\272\346\234\272\346\226\271\351\230\265/README.md" "b/lcp/LCP 39. \346\227\240\344\272\272\346\234\272\346\226\271\351\230\265/README.md"
index 8cd1a6a68043a..43091ae8772c9 100644
--- "a/lcp/LCP 39. \346\227\240\344\272\272\346\234\272\346\226\271\351\230\265/README.md"
+++ "b/lcp/LCP 39. \346\227\240\344\272\272\346\234\272\346\226\271\351\230\265/README.md"
@@ -64,6 +64,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2039.%20%E6%97%A0%
+#### Python3
+
```python
class Solution:
def minimumSwitchingTimes(
@@ -79,6 +81,8 @@ class Solution:
return sum(abs(x) for x in cnt.values()) // 2
```
+#### Java
+
```java
class Solution {
public int minimumSwitchingTimes(int[][] source, int[][] target) {
@@ -102,6 +106,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
func minimumSwitchingTimes(source [][]int, target [][]int) (ans int) {
cnt := map[int]int{}
@@ -148,6 +156,8 @@ func minimumSwitchingTimes(source [][]int, target [][]int) (ans int) {
}
```
+#### TypeScript
+
```ts
function minimumSwitchingTimes(source: number[][], target: number[][]): number {
const cnt: Map = new Map();
diff --git "a/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/README.md" "b/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/README.md"
index 5c94f1b540e10..f500b965aeff8 100644
--- "a/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/README.md"
+++ "b/lcp/LCP 40. \345\277\203\347\256\227\346\214\221\346\210\230/README.md"
@@ -52,6 +52,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2040.%20%E5%BF%83%
+#### Python3
+
```python
class Solution:
def maxmiumScore(self, cards: List[int], cnt: int) -> int:
@@ -67,6 +69,8 @@ class Solution:
return max(ans - a + c, ans - b + d, 0)
```
+#### Java
+
```java
class Solution {
public int maxmiumScore(int[] cards, int cnt) {
@@ -103,6 +107,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -133,6 +139,8 @@ public:
};
```
+#### Go
+
```go
func maxmiumScore(cards []int, cnt int) int {
ans := 0
diff --git "a/lcp/LCP 41. \351\273\221\347\231\275\347\277\273\350\275\254\346\243\213/README.md" "b/lcp/LCP 41. \351\273\221\347\231\275\347\277\273\350\275\254\346\243\213/README.md"
index 1a3e4d672c344..c3e7123e60f62 100644
--- "a/lcp/LCP 41. \351\273\221\347\231\275\347\277\273\350\275\254\346\243\213/README.md"
+++ "b/lcp/LCP 41. \351\273\221\347\231\275\347\277\273\350\275\254\346\243\213/README.md"
@@ -75,6 +75,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2041.%20%E9%BB%91%
+#### Python3
+
```python
class Solution:
def flipChess(self, chessboard: List[str]) -> int:
@@ -105,6 +107,8 @@ class Solution:
)
```
+#### Java
+
```java
class Solution {
private int m;
@@ -168,6 +172,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -225,6 +231,8 @@ public:
};
```
+#### Go
+
```go
func flipChess(chessboard []string) (ans int) {
m, n := len(chessboard), len(chessboard[0])
diff --git "a/lcp/LCP 44. \345\274\200\345\271\225\345\274\217\347\204\260\347\201\253/README.md" "b/lcp/LCP 44. \345\274\200\345\271\225\345\274\217\347\204\260\347\201\253/README.md"
index 4ee059610e41e..7add041f2ff7d 100644
--- "a/lcp/LCP 44. \345\274\200\345\271\225\345\274\217\347\204\260\347\201\253/README.md"
+++ "b/lcp/LCP 44. \345\274\200\345\271\225\345\274\217\347\204\260\347\201\253/README.md"
@@ -46,6 +46,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2044.%20%E5%BC%80%
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -67,6 +69,8 @@ class Solution:
return len(s)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -97,6 +101,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -125,6 +131,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcp/LCP 50. \345\256\235\347\237\263\350\241\245\347\273\231/README.md" "b/lcp/LCP 50. \345\256\235\347\237\263\350\241\245\347\273\231/README.md"
index 9b3243e6459c4..9dcc177c97925 100644
--- "a/lcp/LCP 50. \345\256\235\347\237\263\350\241\245\347\273\231/README.md"
+++ "b/lcp/LCP 50. \345\256\235\347\237\263\350\241\245\347\273\231/README.md"
@@ -75,6 +75,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2050.%20%E5%AE%9D%
+#### Python3
+
```python
class Solution:
def giveGem(self, gem: List[int], operations: List[List[int]]) -> int:
@@ -85,6 +87,8 @@ class Solution:
return max(gem) - min(gem)
```
+#### Java
+
```java
class Solution {
public int giveGem(int[] gem, int[][] operations) {
@@ -104,6 +108,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -121,6 +127,8 @@ public:
};
```
+#### Go
+
```go
func giveGem(gem []int, operations [][]int) int {
for _, op := range operations {
@@ -133,6 +141,8 @@ func giveGem(gem []int, operations [][]int) int {
}
```
+#### TypeScript
+
```ts
function giveGem(gem: number[], operations: number[][]): number {
for (const [x, y] of operations) {
diff --git "a/lcp/LCP 51. \347\203\271\351\245\252\346\226\231\347\220\206/README.md" "b/lcp/LCP 51. \347\203\271\351\245\252\346\226\231\347\220\206/README.md"
index a7cedd8a0efce..747f8cd273976 100644
--- "a/lcp/LCP 51. \347\203\271\351\245\252\346\226\231\347\220\206/README.md"
+++ "b/lcp/LCP 51. \347\203\271\351\245\252\346\226\231\347\220\206/README.md"
@@ -71,6 +71,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2051.%20%E7%83%B9%
+#### Python3
+
```python
class Solution:
def perfectMenu(
@@ -97,6 +99,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int perfectMenu(int[] materials, int[][] cookbooks, int[][] attribute, int limit) {
@@ -129,6 +133,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -162,6 +168,8 @@ public:
};
```
+#### Go
+
```go
func perfectMenu(materials []int, cookbooks [][]int, attribute [][]int, limit int) int {
n := len(cookbooks)
@@ -191,6 +199,8 @@ func perfectMenu(materials []int, cookbooks [][]int, attribute [][]int, limit in
}
```
+#### TypeScript
+
```ts
function perfectMenu(
materials: number[],
diff --git "a/lcp/LCP 52. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\346\237\223\350\211\262/README.md" "b/lcp/LCP 52. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\346\237\223\350\211\262/README.md"
index fccdb9c756977..0acdbbff7b8c7 100644
--- "a/lcp/LCP 52. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\346\237\223\350\211\262/README.md"
+++ "b/lcp/LCP 52. \344\272\214\345\217\211\346\220\234\347\264\242\346\240\221\346\237\223\350\211\262/README.md"
@@ -79,6 +79,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2052.%20%E4%BA%8C%
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -110,6 +112,8 @@ class Solution:
return ans
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -150,6 +154,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -188,6 +194,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
@@ -222,6 +230,8 @@ func getNumber(root *TreeNode, ops [][]int) (ans int) {
}
```
+#### TypeScript
+
```ts
/**
* Definition for a binary tree node.
diff --git "a/lcp/LCP 55. \351\207\207\351\233\206\346\236\234\345\256\236/README.md" "b/lcp/LCP 55. \351\207\207\351\233\206\346\236\234\345\256\236/README.md"
index 5cd1feec3ba86..27f4631c9505d 100644
--- "a/lcp/LCP 55. \351\207\207\351\233\206\346\236\234\345\256\236/README.md"
+++ "b/lcp/LCP 55. \351\207\207\351\233\206\346\236\234\345\256\236/README.md"
@@ -72,6 +72,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2055.%20%E9%87%87%
+#### Python3
+
```python
class Solution:
def getMinimumTime(
@@ -80,6 +82,8 @@ class Solution:
return sum((num + limit - 1) // limit * time[i] for i, num in fruits)
```
+#### Java
+
```java
class Solution {
public int getMinimumTime(int[] time, int[][] fruits, int limit) {
@@ -93,6 +97,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -107,6 +113,8 @@ public:
};
```
+#### Go
+
```go
func getMinimumTime(time []int, fruits [][]int, limit int) (ans int) {
for _, f := range fruits {
@@ -117,6 +125,8 @@ func getMinimumTime(time []int, fruits [][]int, limit int) (ans int) {
}
```
+#### TypeScript
+
```ts
function getMinimumTime(time: number[], fruits: number[][], limit: number): number {
let ans = 0;
diff --git "a/lcp/LCP 56. \344\277\241\347\211\251\344\274\240\351\200\201/README.md" "b/lcp/LCP 56. \344\277\241\347\211\251\344\274\240\351\200\201/README.md"
index 38afefc80f200..b66d379ba9b7d 100644
--- "a/lcp/LCP 56. \344\277\241\347\211\251\344\274\240\351\200\201/README.md"
+++ "b/lcp/LCP 56. \344\277\241\347\211\251\344\274\240\351\200\201/README.md"
@@ -75,6 +75,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2056.%20%E4%BF%A1%
+#### Python3
+
```python
class Solution:
def conveyorBelt(self, matrix: List[str], start: List[int], end: List[int]) -> int:
@@ -100,6 +102,8 @@ class Solution:
q.append((x, y))
```
+#### Java
+
```java
class Solution {
public int conveyorBelt(String[] matrix, int[] start, int[] end) {
@@ -140,6 +144,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -179,6 +185,8 @@ public:
};
```
+#### Go
+
```go
func conveyorBelt(matrix []string, start []int, end []int) int {
dirs := [5]int{-1, 0, 1, 0, -1}
@@ -224,6 +232,8 @@ func conveyorBelt(matrix []string, start []int, end []int) int {
}
```
+#### TypeScript
+
```ts
function conveyorBelt(matrix: string[], start: number[], end: number[]): number {
const dirs = [-1, 0, 1, 0, -1];
diff --git "a/lcp/LCP 61. \346\260\224\346\270\251\345\217\230\345\214\226\350\266\213\345\212\277/README.md" "b/lcp/LCP 61. \346\260\224\346\270\251\345\217\230\345\214\226\350\266\213\345\212\277/README.md"
index 3054a56cbc43c..7c60811922218 100644
--- "a/lcp/LCP 61. \346\260\224\346\270\251\345\217\230\345\214\226\350\266\213\345\212\277/README.md"
+++ "b/lcp/LCP 61. \346\260\224\346\270\251\345\217\230\345\214\226\350\266\213\345\212\277/README.md"
@@ -62,6 +62,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2061.%20%E6%B0%94%
+#### Python3
+
```python
class Solution:
def temperatureTrend(self, temperatureA: List[int], temperatureB: List[int]) -> int:
@@ -78,6 +80,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int temperatureTrend(int[] temperatureA, int[] temperatureB) {
@@ -96,6 +100,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -115,6 +121,8 @@ public:
};
```
+#### Go
+
```go
func temperatureTrend(temperatureA []int, temperatureB []int) int {
ans, f := 0, 0
diff --git "a/lcp/LCP 62. \344\272\244\351\200\232\346\236\242\347\272\275/README.md" "b/lcp/LCP 62. \344\272\244\351\200\232\346\236\242\347\272\275/README.md"
index d27c9d1c12d00..348f106b5e995 100644
--- "a/lcp/LCP 62. \344\272\244\351\200\232\346\236\242\347\272\275/README.md"
+++ "b/lcp/LCP 62. \344\272\244\351\200\232\346\236\242\347\272\275/README.md"
@@ -68,6 +68,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2062.%20%E4%BA%A4%
+#### Python3
+
```python
class Solution:
def transportationHub(self, path: List[List[int]]) -> int:
@@ -89,6 +91,8 @@ class Solution:
return -1
```
+#### Java
+
```java
class Solution {
public int transportationHub(int[][] path) {
@@ -115,6 +119,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -144,6 +150,8 @@ public:
};
```
+#### Go
+
```go
func transportationHub(path [][]int) int {
ind := [1001]int{}
@@ -170,6 +178,8 @@ func transportationHub(path [][]int) int {
}
```
+#### TypeScript
+
```ts
function transportationHub(path: number[][]): number {
const ind: number[] = new Array(1001).fill(0);
diff --git "a/lcp/LCP 63. \345\274\271\347\217\240\346\270\270\346\210\217/README.md" "b/lcp/LCP 63. \345\274\271\347\217\240\346\270\270\346\210\217/README.md"
index 884cabf138037..2d2823b8085a5 100644
--- "a/lcp/LCP 63. \345\274\271\347\217\240\346\270\270\346\210\217/README.md"
+++ "b/lcp/LCP 63. \345\274\271\347\217\240\346\270\270\346\210\217/README.md"
@@ -84,6 +84,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2063.%20%E5%BC%B9%
+#### Python3
+
```python
class Solution:
def ballGame(self, num: int, plate: List[str]) -> List[List[int]]:
@@ -118,6 +120,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private String[] plate;
@@ -174,6 +178,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -222,6 +228,8 @@ public:
};
```
+#### Go
+
```go
func ballGame(num int, plate []string) (ans [][]int) {
dirs := [5]int{0, 1, 0, -1, 0}
diff --git "a/lcp/LCP 64. \344\272\214\345\217\211\346\240\221\347\201\257\351\245\260/README.md" "b/lcp/LCP 64. \344\272\214\345\217\211\346\240\221\347\201\257\351\245\260/README.md"
index ea1d4c7f6c8d8..248022131b176 100644
--- "a/lcp/LCP 64. \344\272\214\345\217\211\346\240\221\347\201\257\351\245\260/README.md"
+++ "b/lcp/LCP 64. \344\272\214\345\217\211\346\240\221\347\201\257\351\245\260/README.md"
@@ -94,6 +94,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2064.%20%E4%BA%8C%
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -124,6 +126,8 @@ class Solution:
return dfs(root)[0]
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -172,6 +176,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -213,6 +219,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcp/LCP 66. \346\234\200\345\260\217\345\261\225\345\217\260\346\225\260\351\207\217/README.md" "b/lcp/LCP 66. \346\234\200\345\260\217\345\261\225\345\217\260\346\225\260\351\207\217/README.md"
index be3884725d96d..b61565afd4889 100644
--- "a/lcp/LCP 66. \346\234\200\345\260\217\345\261\225\345\217\260\346\225\260\351\207\217/README.md"
+++ "b/lcp/LCP 66. \346\234\200\345\260\217\345\261\225\345\217\260\346\225\260\351\207\217/README.md"
@@ -61,6 +61,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2066.%20%E6%9C%80%
+#### Python3
+
```python
class Solution:
def minNumBooths(self, demand: List[str]) -> int:
@@ -77,6 +79,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int minNumBooths(String[] demand) {
@@ -101,6 +105,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -124,6 +130,8 @@ public:
};
```
+#### Go
+
```go
func minNumBooths(demand []string) (ans int) {
cnt := [26]int{}
diff --git "a/lcp/LCP 67. \350\243\205\351\245\260\346\240\221/README.md" "b/lcp/LCP 67. \350\243\205\351\245\260\346\240\221/README.md"
index e07acb1dac4b6..e4d4babb6c862 100644
--- "a/lcp/LCP 67. \350\243\205\351\245\260\346\240\221/README.md"
+++ "b/lcp/LCP 67. \350\243\205\351\245\260\346\240\221/README.md"
@@ -67,6 +67,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2067.%20%E8%A3%85%
+#### Python3
+
```python
# Definition for a binary tree node.
# class TreeNode:
@@ -89,6 +91,8 @@ class Solution:
return dfs(root)
```
+#### Java
+
```java
/**
* Definition for a binary tree node.
@@ -127,6 +131,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for a binary tree node.
@@ -161,6 +167,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for a binary tree node.
diff --git "a/lcp/LCP 68. \347\276\216\350\247\202\347\232\204\350\212\261\346\235\237/README.md" "b/lcp/LCP 68. \347\276\216\350\247\202\347\232\204\350\212\261\346\235\237/README.md"
index 732699c5fe43a..dca809e537dc9 100644
--- "a/lcp/LCP 68. \347\276\216\350\247\202\347\232\204\350\212\261\346\235\237/README.md"
+++ "b/lcp/LCP 68. \347\276\216\350\247\202\347\232\204\350\212\261\346\235\237/README.md"
@@ -66,6 +66,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2068.%20%E7%BE%8E%
+#### Python3
+
```python
class Solution:
def beautifulBouquet(self, flowers: List[int], cnt: int) -> int:
@@ -81,6 +83,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int beautifulBouquet(int[] flowers, int cnt) {
@@ -103,6 +107,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -124,6 +130,8 @@ public:
};
```
+#### Go
+
```go
func beautifulBouquet(flowers []int, cnt int) (ans int) {
mx := slices.Max(flowers)
diff --git "a/lcp/LCP 70. \346\262\231\345\234\260\346\262\273\347\220\206/README.md" "b/lcp/LCP 70. \346\262\231\345\234\260\346\262\273\347\220\206/README.md"
index 60d238af3f6d3..92170db889c44 100644
--- "a/lcp/LCP 70. \346\262\231\345\234\260\346\262\273\347\220\206/README.md"
+++ "b/lcp/LCP 70. \346\262\231\345\234\260\346\262\273\347\220\206/README.md"
@@ -73,6 +73,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2070.%20%E6%B2%99%
+#### Python3
+
```python
class Solution:
def sandyLandManagement(self, size: int) -> List[List[int]]:
@@ -93,6 +95,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int[][] sandyLandManagement(int size) {
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -144,6 +150,8 @@ public:
};
```
+#### Go
+
```go
func sandyLandManagement(size int) (ans [][]int) {
ans = append(ans, []int{1, 1})
diff --git "a/lcp/LCP 72. \350\241\245\347\273\231\351\251\254\350\275\246/README.md" "b/lcp/LCP 72. \350\241\245\347\273\231\351\251\254\350\275\246/README.md"
index dbb06a0d78bcf..0ed36ba14ccb1 100644
--- "a/lcp/LCP 72. \350\241\245\347\273\231\351\251\254\350\275\246/README.md"
+++ "b/lcp/LCP 72. \350\241\245\347\273\231\351\251\254\350\275\246/README.md"
@@ -57,6 +57,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2072.%20%E8%A1%A5%
+#### Python3
+
```python
class Solution:
def supplyWagon(self, supplies: List[int]) -> List[int]:
@@ -82,6 +84,8 @@ class Solution:
return supplies
```
+#### Java
+
```java
class Solution {
public int[] supplyWagon(int[] supplies) {
@@ -112,6 +116,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -143,6 +149,8 @@ public:
};
```
+#### Go
+
```go
func supplyWagon(supplies []int) []int {
for h := (len(supplies) + 1) >> 1; h > 0; h-- {
@@ -171,6 +179,8 @@ func supplyWagon(supplies []int) []int {
}
```
+#### TypeScript
+
```ts
function supplyWagon(supplies: number[]): number[] {
for (let h = (supplies.length + 1) >> 1; h > 0; --h) {
diff --git "a/lcp/LCP 77. \347\254\246\346\226\207\345\202\250\345\244\207/README.md" "b/lcp/LCP 77. \347\254\246\346\226\207\345\202\250\345\244\207/README.md"
index d2d0c3712db00..e22025fa62b21 100644
--- "a/lcp/LCP 77. \347\254\246\346\226\207\345\202\250\345\244\207/README.md"
+++ "b/lcp/LCP 77. \347\254\246\346\226\207\345\202\250\345\244\207/README.md"
@@ -56,6 +56,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2077.%20%E7%AC%A6%
+#### Python3
+
```python
class Solution:
def runeReserve(self, runes: List[int]) -> int:
@@ -69,6 +71,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int runeReserve(int[] runes) {
@@ -86,6 +90,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -104,6 +110,8 @@ public:
};
```
+#### Go
+
```go
func runeReserve(runes []int) (ans int) {
sort.Ints(runes)
@@ -119,6 +127,8 @@ func runeReserve(runes []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function runeReserve(runes: number[]): number {
runes.sort((a, b) => a - b);
diff --git "a/lcp/LCP 78. \345\237\216\345\242\231\351\230\262\347\272\277/README.md" "b/lcp/LCP 78. \345\237\216\345\242\231\351\230\262\347\272\277/README.md"
index 517002f0811e7..7762f747189e8 100644
--- "a/lcp/LCP 78. \345\237\216\345\242\231\351\230\262\347\272\277/README.md"
+++ "b/lcp/LCP 78. \345\237\216\345\242\231\351\230\262\347\272\277/README.md"
@@ -70,6 +70,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2078.%20%E5%9F%8E%
+#### Python3
+
```python
class Solution:
def rampartDefensiveLine(self, rampart: List[List[int]]) -> int:
@@ -94,6 +96,8 @@ class Solution:
return left
```
+#### Java
+
```java
class Solution {
private int[][] rampart;
@@ -128,6 +132,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -160,6 +166,8 @@ public:
};
```
+#### Go
+
```go
func rampartDefensiveLine(rampart [][]int) int {
check := func(w int) bool {
@@ -189,6 +197,8 @@ func rampartDefensiveLine(rampart [][]int) int {
}
```
+#### TypeScript
+
```ts
function rampartDefensiveLine(rampart: number[][]): number {
const check = (w: number): boolean => {
diff --git "a/lcp/LCP 79. \346\217\220\345\217\226\345\222\222\346\226\207/README.md" "b/lcp/LCP 79. \346\217\220\345\217\226\345\222\222\346\226\207/README.md"
index 17154e53b260b..3b4f2c3f17dec 100644
--- "a/lcp/LCP 79. \346\217\220\345\217\226\345\222\222\346\226\207/README.md"
+++ "b/lcp/LCP 79. \346\217\220\345\217\226\345\222\222\346\226\207/README.md"
@@ -58,6 +58,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcp/LCP%2079.%20%E6%8F%90%
+#### Python3
+
```python
class Solution:
def extractMantra(self, matrix: List[str], mantra: str) -> int:
@@ -88,6 +90,8 @@ class Solution:
return -1
```
+#### Java
+
```java
class Solution {
public int extractMantra(String[] matrix, String mantra) {
@@ -125,6 +129,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -163,6 +169,8 @@ public:
};
```
+#### Go
+
```go
func extractMantra(matrix []string, mantra string) (ans int) {
m, n, l := len(matrix), len(matrix[0]), len(mantra)
@@ -202,6 +210,8 @@ func extractMantra(matrix []string, mantra string) (ans int) {
}
```
+#### TypeScript
+
```ts
function extractMantra(matrix: string[], mantra: string): number {
const [m, n, l] = [matrix.length, matrix[0].length, mantra.length];
diff --git "a/lcs/LCS 01. \344\270\213\350\275\275\346\217\222\344\273\266/README.md" "b/lcs/LCS 01. \344\270\213\350\275\275\346\217\222\344\273\266/README.md"
index 3fee2dfc22a77..9354097174cd6 100644
--- "a/lcs/LCS 01. \344\270\213\350\275\275\346\217\222\344\273\266/README.md"
+++ "b/lcs/LCS 01. \344\270\213\350\275\275\346\217\222\344\273\266/README.md"
@@ -62,6 +62,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcs/LCS%2001.%20%E4%B8%8B%
+#### Python3
+
```python
class Solution:
def leastMinutes(self, n: int) -> int:
@@ -72,6 +74,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int leastMinutes(int n) {
@@ -84,6 +88,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -97,6 +103,8 @@ public:
};
```
+#### Go
+
```go
func leastMinutes(n int) int {
ans := 1
@@ -107,6 +115,8 @@ func leastMinutes(n int) int {
}
```
+#### TypeScript
+
```ts
function leastMinutes(n: number): number {
let ans = 1;
@@ -117,6 +127,8 @@ function leastMinutes(n: number): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
diff --git "a/lcs/LCS 02. \345\256\214\346\210\220\344\270\200\345\215\212\351\242\230\347\233\256/README.md" "b/lcs/LCS 02. \345\256\214\346\210\220\344\270\200\345\215\212\351\242\230\347\233\256/README.md"
index 4c46c08fa23b5..2fd21571d52f7 100644
--- "a/lcs/LCS 02. \345\256\214\346\210\220\344\270\200\345\215\212\351\242\230\347\233\256/README.md"
+++ "b/lcs/LCS 02. \345\256\214\346\210\220\344\270\200\345\215\212\351\242\230\347\233\256/README.md"
@@ -53,6 +53,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcs/LCS%2002.%20%E5%AE%8C%
+#### Python3
+
```python
class Solution:
def halfQuestions(self, questions: List[int]) -> int:
@@ -66,6 +68,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int halfQuestions(int[] questions) {
@@ -85,6 +89,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -104,6 +110,8 @@ public:
};
```
+#### Go
+
```go
func halfQuestions(questions []int) (ans int) {
cnt := make([]int, 1010)
@@ -120,6 +128,8 @@ func halfQuestions(questions []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function halfQuestions(questions: number[]): number {
const cnt = new Array(1010).fill(0);
@@ -137,6 +147,8 @@ function halfQuestions(questions: number[]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} questions
diff --git "a/lcs/LCS 03. \344\270\273\351\242\230\347\251\272\351\227\264/README.md" "b/lcs/LCS 03. \344\270\273\351\242\230\347\251\272\351\227\264/README.md"
index f1b102725df02..f97ab38ba88c6 100644
--- "a/lcs/LCS 03. \344\270\273\351\242\230\347\251\272\351\227\264/README.md"
+++ "b/lcs/LCS 03. \344\270\273\351\242\230\347\251\272\351\227\264/README.md"
@@ -49,6 +49,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/lcs/LCS%2003.%20%E4%B8%BB%
+#### Python3
+
```python
class Solution:
def largestArea(self, grid: List[str]) -> int:
@@ -84,6 +86,8 @@ class Solution:
)
```
+#### Java
+
```java
class Solution {
private int[] p;
@@ -136,6 +140,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -177,6 +183,8 @@ public:
};
```
+#### Go
+
```go
func largestArea(grid []string) int {
m, n := len(grid), len(grid[0])
@@ -221,6 +229,8 @@ func largestArea(grid []string) int {
}
```
+#### JavaScript
+
```js
/**
* @param {string[]} grid
diff --git a/solution/0000-0099/0001.Two Sum/README.md b/solution/0000-0099/0001.Two Sum/README.md
index c32137478b0ab..41f53671375c1 100644
--- a/solution/0000-0099/0001.Two Sum/README.md
+++ b/solution/0000-0099/0001.Two Sum/README.md
@@ -78,6 +78,8 @@ tags:
+#### Python3
+
```python
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
@@ -89,6 +91,8 @@ class Solution:
m[x] = i
```
+#### Java
+
```java
class Solution {
public int[] twoSum(int[] nums, int target) {
@@ -105,6 +109,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -122,6 +128,8 @@ public:
};
```
+#### Go
+
```go
func twoSum(nums []int, target int) []int {
m := map[int]int{}
@@ -136,6 +144,8 @@ func twoSum(nums []int, target int) []int {
}
```
+#### TypeScript
+
```ts
function twoSum(nums: number[], target: number): number[] {
const m: Map = new Map();
@@ -153,6 +163,8 @@ function twoSum(nums: number[], target: number): number[] {
}
```
+#### Rust
+
```rust
use std::collections::HashMap;
@@ -171,6 +183,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -190,6 +204,8 @@ var twoSum = function (nums, target) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] TwoSum(int[] nums, int target) {
@@ -208,6 +224,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -228,6 +246,8 @@ class Solution {
}
```
+#### Scala
+
```scala
import scala.collection.mutable
@@ -246,6 +266,8 @@ object Solution {
}
```
+#### Swift
+
```swift
class Solution {
func twoSum(_ nums: [Int], _ target: Int) -> [Int] {
@@ -264,6 +286,8 @@ class Solution {
}
```
+#### Ruby
+
```rb
# @param {Integer[]} nums
# @param {Integer} target
@@ -278,6 +302,8 @@ def two_sum(nums, target)
end
```
+#### Nim
+
```nim
import std/enumerate
diff --git a/solution/0000-0099/0001.Two Sum/README_EN.md b/solution/0000-0099/0001.Two Sum/README_EN.md
index e54a44270f952..798d0152d3b24 100644
--- a/solution/0000-0099/0001.Two Sum/README_EN.md
+++ b/solution/0000-0099/0001.Two Sum/README_EN.md
@@ -75,6 +75,8 @@ The time complexity is $O(n)$ and the space complexity is $O(n)$. Where $n$ is t
+#### Python3
+
```python
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
@@ -86,6 +88,8 @@ class Solution:
m[x] = i
```
+#### Java
+
```java
class Solution {
public int[] twoSum(int[] nums, int target) {
@@ -102,6 +106,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -119,6 +125,8 @@ public:
};
```
+#### Go
+
```go
func twoSum(nums []int, target int) []int {
m := map[int]int{}
@@ -133,6 +141,8 @@ func twoSum(nums []int, target int) []int {
}
```
+#### TypeScript
+
```ts
function twoSum(nums: number[], target: number): number[] {
const m: Map = new Map();
@@ -150,6 +160,8 @@ function twoSum(nums: number[], target: number): number[] {
}
```
+#### Rust
+
```rust
use std::collections::HashMap;
@@ -168,6 +180,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -187,6 +201,8 @@ var twoSum = function (nums, target) {
};
```
+#### C#
+
```cs
public class Solution {
public int[] TwoSum(int[] nums, int target) {
@@ -205,6 +221,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -225,6 +243,8 @@ class Solution {
}
```
+#### Scala
+
```scala
import scala.collection.mutable
@@ -243,6 +263,8 @@ object Solution {
}
```
+#### Swift
+
```swift
class Solution {
func twoSum(_ nums: [Int], _ target: Int) -> [Int] {
@@ -261,6 +283,8 @@ class Solution {
}
```
+#### Ruby
+
```rb
# @param {Integer[]} nums
# @param {Integer} target
@@ -275,6 +299,8 @@ def two_sum(nums, target)
end
```
+#### Nim
+
```nim
import std/enumerate
diff --git a/solution/0000-0099/0002.Add Two Numbers/README.md b/solution/0000-0099/0002.Add Two Numbers/README.md
index 2fb63fd9a8121..dc7cbcc5b8fc1 100644
--- a/solution/0000-0099/0002.Add Two Numbers/README.md
+++ b/solution/0000-0099/0002.Add Two Numbers/README.md
@@ -76,6 +76,8 @@ tags:
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -98,6 +100,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -127,6 +131,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -157,6 +163,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -191,6 +199,8 @@ func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -225,6 +235,8 @@ function addTwoNumbers(l1: ListNode | null, l2: ListNode | null): ListNode | nul
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -268,6 +280,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -297,6 +311,8 @@ var addTwoNumbers = function (l1, l2) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -327,6 +343,8 @@ public class Solution {
}
```
+#### PHP
+
```php
/**
* Definition for a singly-linked list.
@@ -377,6 +395,8 @@ class Solution {
}
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
@@ -408,6 +428,8 @@ class Solution {
}
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
@@ -436,6 +458,8 @@ def add_two_numbers(l1, l2)
end
```
+#### Nim
+
```nim
#[
# Driver code in the solution file
diff --git a/solution/0000-0099/0002.Add Two Numbers/README_EN.md b/solution/0000-0099/0002.Add Two Numbers/README_EN.md
index 75cc889ad3e23..0692de009adbe 100644
--- a/solution/0000-0099/0002.Add Two Numbers/README_EN.md
+++ b/solution/0000-0099/0002.Add Two Numbers/README_EN.md
@@ -72,6 +72,8 @@ The time complexity is $O(\max (m, n))$, where $m$ and $n$ are the lengths of th
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -94,6 +96,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -123,6 +127,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -153,6 +159,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -187,6 +195,8 @@ func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -221,6 +231,8 @@ function addTwoNumbers(l1: ListNode | null, l2: ListNode | null): ListNode | nul
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -264,6 +276,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -293,6 +307,8 @@ var addTwoNumbers = function (l1, l2) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -323,6 +339,8 @@ public class Solution {
}
```
+#### PHP
+
```php
/**
* Definition for a singly-linked list.
@@ -373,6 +391,8 @@ class Solution {
}
```
+#### Swift
+
```swift
/**
* Definition for singly-linked list.
@@ -404,6 +424,8 @@ class Solution {
}
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
@@ -432,6 +454,8 @@ def add_two_numbers(l1, l2)
end
```
+#### Nim
+
```nim
#[
# Driver code in the solution file
diff --git a/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README.md b/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README.md
index ecebe4c2c2b10..3ccff6d099d5b 100644
--- a/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README.md
+++ b/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README.md
@@ -85,6 +85,8 @@ for (int i = 0, j = 0; i < n; ++i) {
+#### Python3
+
```python
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
@@ -99,6 +101,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int lengthOfLongestSubstring(String s) {
@@ -117,6 +121,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -135,6 +141,8 @@ public:
};
```
+#### Go
+
```go
func lengthOfLongestSubstring(s string) (ans int) {
ss := [128]bool{}
@@ -150,6 +158,8 @@ func lengthOfLongestSubstring(s string) (ans int) {
}
```
+#### TypeScript
+
```ts
function lengthOfLongestSubstring(s: string): number {
let ans = 0;
@@ -165,6 +175,8 @@ function lengthOfLongestSubstring(s: string): number {
}
```
+#### Rust
+
```rust
use std::collections::HashSet;
@@ -189,6 +201,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -208,6 +222,8 @@ var lengthOfLongestSubstring = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public int LengthOfLongestSubstring(string s) {
@@ -225,6 +241,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -246,6 +264,8 @@ class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func lengthOfLongestSubstring(_ s: String) -> Int {
@@ -268,6 +288,8 @@ class Solution {
}
```
+#### Nim
+
```nim
proc lengthOfLongestSubstring(s: string): int =
var
diff --git a/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README_EN.md b/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README_EN.md
index f4bd7fb479124..699444fecaaf9 100644
--- a/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README_EN.md
+++ b/solution/0000-0099/0003.Longest Substring Without Repeating Characters/README_EN.md
@@ -83,6 +83,8 @@ for (int i = 0, j = 0; i < n; ++i) {
+#### Python3
+
```python
class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
@@ -97,6 +99,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int lengthOfLongestSubstring(String s) {
@@ -115,6 +119,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -133,6 +139,8 @@ public:
};
```
+#### Go
+
```go
func lengthOfLongestSubstring(s string) (ans int) {
ss := [128]bool{}
@@ -148,6 +156,8 @@ func lengthOfLongestSubstring(s string) (ans int) {
}
```
+#### TypeScript
+
```ts
function lengthOfLongestSubstring(s: string): number {
let ans = 0;
@@ -163,6 +173,8 @@ function lengthOfLongestSubstring(s: string): number {
}
```
+#### Rust
+
```rust
use std::collections::HashSet;
@@ -187,6 +199,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -206,6 +220,8 @@ var lengthOfLongestSubstring = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public int LengthOfLongestSubstring(string s) {
@@ -223,6 +239,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -244,6 +262,8 @@ class Solution {
}
```
+#### Swift
+
```swift
class Solution {
func lengthOfLongestSubstring(_ s: String) -> Int {
@@ -266,6 +286,8 @@ class Solution {
}
```
+#### Nim
+
```nim
proc lengthOfLongestSubstring(s: string): int =
var
diff --git a/solution/0000-0099/0004.Median of Two Sorted Arrays/README.md b/solution/0000-0099/0004.Median of Two Sorted Arrays/README.md
index f4e4124458454..a0c5af52f0caa 100644
--- a/solution/0000-0099/0004.Median of Two Sorted Arrays/README.md
+++ b/solution/0000-0099/0004.Median of Two Sorted Arrays/README.md
@@ -82,6 +82,8 @@ tags:
+#### Python3
+
```python
class Solution:
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
@@ -103,6 +105,8 @@ class Solution:
return (a + b) / 2
```
+#### Java
+
```java
class Solution {
private int m;
@@ -138,6 +142,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -165,6 +171,8 @@ public:
};
```
+#### Go
+
```go
func findMedianSortedArrays(nums1 []int, nums2 []int) float64 {
m, n := len(nums1), len(nums2)
@@ -197,6 +205,8 @@ func findMedianSortedArrays(nums1 []int, nums2 []int) float64 {
}
```
+#### TypeScript
+
```ts
function findMedianSortedArrays(nums1: number[], nums2: number[]): number {
const m = nums1.length;
@@ -222,6 +232,8 @@ function findMedianSortedArrays(nums1: number[], nums2: number[]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums1
@@ -252,6 +264,8 @@ var findMedianSortedArrays = function (nums1, nums2) {
};
```
+#### C#
+
```cs
public class Solution {
private int m;
@@ -287,6 +301,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -309,6 +325,8 @@ class Solution {
}
```
+#### Nim
+
```nim
import std/[algorithm, sequtils]
diff --git a/solution/0000-0099/0004.Median of Two Sorted Arrays/README_EN.md b/solution/0000-0099/0004.Median of Two Sorted Arrays/README_EN.md
index a5091223f0bb5..15b73ee6ff6f0 100644
--- a/solution/0000-0099/0004.Median of Two Sorted Arrays/README_EN.md
+++ b/solution/0000-0099/0004.Median of Two Sorted Arrays/README_EN.md
@@ -78,6 +78,8 @@ The time complexity is $O(\log(m + n))$, and the space complexity is $O(\log(m +
+#### Python3
+
```python
class Solution:
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
@@ -99,6 +101,8 @@ class Solution:
return (a + b) / 2
```
+#### Java
+
```java
class Solution {
private int m;
@@ -134,6 +138,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -161,6 +167,8 @@ public:
};
```
+#### Go
+
```go
func findMedianSortedArrays(nums1 []int, nums2 []int) float64 {
m, n := len(nums1), len(nums2)
@@ -193,6 +201,8 @@ func findMedianSortedArrays(nums1 []int, nums2 []int) float64 {
}
```
+#### TypeScript
+
```ts
function findMedianSortedArrays(nums1: number[], nums2: number[]): number {
const m = nums1.length;
@@ -218,6 +228,8 @@ function findMedianSortedArrays(nums1: number[], nums2: number[]): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums1
@@ -248,6 +260,8 @@ var findMedianSortedArrays = function (nums1, nums2) {
};
```
+#### C#
+
```cs
public class Solution {
private int m;
@@ -283,6 +297,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -305,6 +321,8 @@ class Solution {
}
```
+#### Nim
+
```nim
import std/[algorithm, sequtils]
diff --git a/solution/0000-0099/0005.Longest Palindromic Substring/README.md b/solution/0000-0099/0005.Longest Palindromic Substring/README.md
index 277c8e44a5e91..f3bec1c5b0771 100644
--- a/solution/0000-0099/0005.Longest Palindromic Substring/README.md
+++ b/solution/0000-0099/0005.Longest Palindromic Substring/README.md
@@ -68,6 +68,8 @@ tags:
+#### Python3
+
```python
class Solution:
def longestPalindrome(self, s: str) -> str:
@@ -84,6 +86,8 @@ class Solution:
return s[k : k + mx]
```
+#### Java
+
```java
class Solution {
public String longestPalindrome(String s) {
@@ -110,6 +114,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -134,6 +140,8 @@ public:
};
```
+#### Go
+
```go
func longestPalindrome(s string) string {
n := len(s)
@@ -161,6 +169,8 @@ func longestPalindrome(s string) string {
}
```
+#### TypeScript
+
```ts
function longestPalindrome(s: string): string {
const n = s.length;
@@ -185,6 +195,8 @@ function longestPalindrome(s: string): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn longest_palindrome(s: String) -> String {
@@ -207,6 +219,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -235,6 +249,8 @@ var longestPalindrome = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public string LongestPalindrome(string s) {
@@ -263,6 +279,8 @@ public class Solution {
}
```
+#### Nim
+
```nim
import std/sequtils
@@ -301,6 +319,8 @@ proc longestPalindrome(s: string): string =
+#### Python3
+
```python
class Solution:
def longestPalindrome(self, s: str) -> str:
@@ -321,6 +341,8 @@ class Solution:
return s[start : start + mx]
```
+#### Java
+
```java
class Solution {
private String s;
@@ -352,6 +374,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -378,6 +402,8 @@ public:
};
```
+#### Go
+
```go
func longestPalindrome(s string) string {
n := len(s)
@@ -400,6 +426,8 @@ func longestPalindrome(s string) string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_palindrome(s: &str) -> bool {
@@ -430,6 +458,8 @@ impl Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0005.Longest Palindromic Substring/README_EN.md b/solution/0000-0099/0005.Longest Palindromic Substring/README_EN.md
index 900d5933b32ed..895bbb34ed3ff 100644
--- a/solution/0000-0099/0005.Longest Palindromic Substring/README_EN.md
+++ b/solution/0000-0099/0005.Longest Palindromic Substring/README_EN.md
@@ -64,6 +64,8 @@ The time complexity is $O(n^2)$, and the space complexity is $O(n^2)$. Here, $n$
+#### Python3
+
```python
class Solution:
def longestPalindrome(self, s: str) -> str:
@@ -80,6 +82,8 @@ class Solution:
return s[k : k + mx]
```
+#### Java
+
```java
class Solution {
public String longestPalindrome(String s) {
@@ -106,6 +110,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -130,6 +136,8 @@ public:
};
```
+#### Go
+
```go
func longestPalindrome(s string) string {
n := len(s)
@@ -157,6 +165,8 @@ func longestPalindrome(s string) string {
}
```
+#### TypeScript
+
```ts
function longestPalindrome(s: string): string {
const n = s.length;
@@ -181,6 +191,8 @@ function longestPalindrome(s: string): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn longest_palindrome(s: String) -> String {
@@ -203,6 +215,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -231,6 +245,8 @@ var longestPalindrome = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public string LongestPalindrome(string s) {
@@ -259,6 +275,8 @@ public class Solution {
}
```
+#### Nim
+
```nim
import std/sequtils
@@ -297,6 +315,8 @@ The time complexity is $O(n^2)$, and the space complexity is $O(1)$. Here, $n$ i
+#### Python3
+
```python
class Solution:
def longestPalindrome(self, s: str) -> str:
@@ -317,6 +337,8 @@ class Solution:
return s[start : start + mx]
```
+#### Java
+
```java
class Solution {
private String s;
@@ -348,6 +370,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -374,6 +398,8 @@ public:
};
```
+#### Go
+
```go
func longestPalindrome(s string) string {
n := len(s)
@@ -396,6 +422,8 @@ func longestPalindrome(s string) string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_palindrome(s: &str) -> bool {
@@ -426,6 +454,8 @@ impl Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0006.Zigzag Conversion/README.md b/solution/0000-0099/0006.Zigzag Conversion/README.md
index 2c791a6a52c7f..c12bad03a22aa 100644
--- a/solution/0000-0099/0006.Zigzag Conversion/README.md
+++ b/solution/0000-0099/0006.Zigzag Conversion/README.md
@@ -86,6 +86,8 @@ P I
+#### Python3
+
```python
class Solution:
def convert(self, s: str, numRows: int) -> str:
@@ -101,6 +103,8 @@ class Solution:
return ''.join(chain(*g))
```
+#### Java
+
```java
class Solution {
public String convert(String s, int numRows) {
@@ -122,6 +126,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -147,6 +153,8 @@ public:
};
```
+#### Go
+
```go
func convert(s string, numRows int) string {
if numRows == 1 {
@@ -165,6 +173,8 @@ func convert(s string, numRows int) string {
}
```
+#### TypeScript
+
```ts
function convert(s: string, numRows: number): string {
if (numRows === 1) {
@@ -184,6 +194,8 @@ function convert(s: string, numRows: number): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn convert(s: String, num_rows: i32) -> String {
@@ -214,6 +226,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -238,6 +252,8 @@ var convert = function (s, numRows) {
};
```
+#### C#
+
```cs
public class Solution {
public string Convert(string s, int numRows) {
@@ -276,6 +292,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def convert(self, s: str, numRows: int) -> str:
@@ -295,6 +313,8 @@ class Solution:
return ''.join(ans)
```
+#### Java
+
```java
class Solution {
public String convert(String s, int numRows) {
@@ -320,6 +340,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -342,6 +364,8 @@ public:
};
```
+#### Go
+
```go
func convert(s string, numRows int) string {
if numRows == 1 {
@@ -365,6 +389,8 @@ func convert(s string, numRows int) string {
}
```
+#### TypeScript
+
```ts
function convert(s: string, numRows: number): string {
if (numRows === 1) {
@@ -388,6 +414,8 @@ function convert(s: string, numRows: number): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn convert(s: String, num_rows: i32) -> String {
@@ -400,6 +428,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -429,6 +459,8 @@ var convert = function (s, numRows) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0006.Zigzag Conversion/README_EN.md b/solution/0000-0099/0006.Zigzag Conversion/README_EN.md
index 16ce4b3b8242a..04390da8f24e7 100644
--- a/solution/0000-0099/0006.Zigzag Conversion/README_EN.md
+++ b/solution/0000-0099/0006.Zigzag Conversion/README_EN.md
@@ -84,6 +84,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def convert(self, s: str, numRows: int) -> str:
@@ -99,6 +101,8 @@ class Solution:
return ''.join(chain(*g))
```
+#### Java
+
```java
class Solution {
public String convert(String s, int numRows) {
@@ -120,6 +124,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -145,6 +151,8 @@ public:
};
```
+#### Go
+
```go
func convert(s string, numRows int) string {
if numRows == 1 {
@@ -163,6 +171,8 @@ func convert(s string, numRows int) string {
}
```
+#### TypeScript
+
```ts
function convert(s: string, numRows: number): string {
if (numRows === 1) {
@@ -182,6 +192,8 @@ function convert(s: string, numRows: number): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn convert(s: String, num_rows: i32) -> String {
@@ -212,6 +224,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -236,6 +250,8 @@ var convert = function (s, numRows) {
};
```
+#### C#
+
```cs
public class Solution {
public string Convert(string s, int numRows) {
@@ -274,6 +290,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def convert(self, s: str, numRows: int) -> str:
@@ -293,6 +311,8 @@ class Solution:
return ''.join(ans)
```
+#### Java
+
```java
class Solution {
public String convert(String s, int numRows) {
@@ -318,6 +338,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -340,6 +362,8 @@ public:
};
```
+#### Go
+
```go
func convert(s string, numRows int) string {
if numRows == 1 {
@@ -363,6 +387,8 @@ func convert(s string, numRows int) string {
}
```
+#### TypeScript
+
```ts
function convert(s: string, numRows: number): string {
if (numRows === 1) {
@@ -386,6 +412,8 @@ function convert(s: string, numRows: number): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn convert(s: String, num_rows: i32) -> String {
@@ -398,6 +426,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -427,6 +457,8 @@ var convert = function (s, numRows) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0007.Reverse Integer/README.md b/solution/0000-0099/0007.Reverse Integer/README.md
index 38fe12b4bf251..2a415a12be25c 100644
--- a/solution/0000-0099/0007.Reverse Integer/README.md
+++ b/solution/0000-0099/0007.Reverse Integer/README.md
@@ -89,6 +89,8 @@ tags:
+#### Python3
+
```python
class Solution:
def reverse(self, x: int) -> int:
@@ -105,6 +107,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int reverse(int x) {
@@ -120,6 +124,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
func reverse(x int) (ans int) {
for ; x != 0; x /= 10 {
@@ -148,6 +156,8 @@ func reverse(x int) (ans int) {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn reverse(mut x: i32) -> i32 {
@@ -160,6 +170,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} x
@@ -179,6 +191,8 @@ var reverse = function (x) {
};
```
+#### C#
+
```cs
public class Solution {
public int Reverse(int x) {
@@ -194,6 +208,8 @@ public class Solution {
}
```
+#### C
+
```c
int reverse(int x) {
int ans = 0;
@@ -207,6 +223,8 @@ int reverse(int x) {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0007.Reverse Integer/README_EN.md b/solution/0000-0099/0007.Reverse Integer/README_EN.md
index 5e29c51552330..f4780e71e3874 100644
--- a/solution/0000-0099/0007.Reverse Integer/README_EN.md
+++ b/solution/0000-0099/0007.Reverse Integer/README_EN.md
@@ -79,6 +79,8 @@ The time complexity is $O(\log |x|)$, where $|x|$ is the absolute value of $x$.
+#### Python3
+
```python
class Solution:
def reverse(self, x: int) -> int:
@@ -95,6 +97,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int reverse(int x) {
@@ -110,6 +114,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
func reverse(x int) (ans int) {
for ; x != 0; x /= 10 {
@@ -138,6 +146,8 @@ func reverse(x int) (ans int) {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn reverse(mut x: i32) -> i32 {
@@ -150,6 +160,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} x
@@ -169,6 +181,8 @@ var reverse = function (x) {
};
```
+#### C#
+
```cs
public class Solution {
public int Reverse(int x) {
@@ -184,6 +198,8 @@ public class Solution {
}
```
+#### C
+
```c
int reverse(int x) {
int ans = 0;
@@ -197,6 +213,8 @@ int reverse(int x) {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0008.String to Integer (atoi)/README.md b/solution/0000-0099/0008.String to Integer (atoi)/README.md
index cf0b9ff5d6052..a1c189c4a6ce7 100644
--- a/solution/0000-0099/0008.String to Integer (atoi)/README.md
+++ b/solution/0000-0099/0008.String to Integer (atoi)/README.md
@@ -151,6 +151,8 @@ tags:
+#### Python3
+
```python
class Solution:
def myAtoi(self, s: str) -> int:
@@ -182,6 +184,8 @@ class Solution:
return sign * res
```
+#### Java
+
```java
class Solution {
public int myAtoi(String s) {
@@ -210,6 +214,8 @@ class Solution {
}
```
+#### Go
+
```go
func myAtoi(s string) int {
i, n := 0, len(s)
@@ -248,6 +254,8 @@ func myAtoi(s string) int {
}
```
+#### JavaScript
+
```js
const myAtoi = function (str) {
str = str.trim();
@@ -275,6 +283,8 @@ const myAtoi = function (str) {
};
```
+#### C#
+
```cs
// https://leetcode.com/problems/string-to-integer-atoi/
@@ -324,6 +334,8 @@ public partial class Solution
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0008.String to Integer (atoi)/README_EN.md b/solution/0000-0099/0008.String to Integer (atoi)/README_EN.md
index 9da65f92ec995..23069a9df45fe 100644
--- a/solution/0000-0099/0008.String to Integer (atoi)/README_EN.md
+++ b/solution/0000-0099/0008.String to Integer (atoi)/README_EN.md
@@ -147,6 +147,8 @@ The time complexity is $O(n)$, where $n$ is the length of the string. We only ne
+#### Python3
+
```python
class Solution:
def myAtoi(self, s: str) -> int:
@@ -178,6 +180,8 @@ class Solution:
return sign * res
```
+#### Java
+
```java
class Solution {
public int myAtoi(String s) {
@@ -206,6 +210,8 @@ class Solution {
}
```
+#### Go
+
```go
func myAtoi(s string) int {
i, n := 0, len(s)
@@ -244,6 +250,8 @@ func myAtoi(s string) int {
}
```
+#### JavaScript
+
```js
const myAtoi = function (str) {
str = str.trim();
@@ -271,6 +279,8 @@ const myAtoi = function (str) {
};
```
+#### C#
+
```cs
// https://leetcode.com/problems/string-to-integer-atoi/
@@ -320,6 +330,8 @@ public partial class Solution
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0009.Palindrome Number/README.md b/solution/0000-0099/0009.Palindrome Number/README.md
index 7f9d1404acec0..ad40d6e7dc472 100644
--- a/solution/0000-0099/0009.Palindrome Number/README.md
+++ b/solution/0000-0099/0009.Palindrome Number/README.md
@@ -93,6 +93,8 @@ tags:
+#### Python3
+
```python
class Solution:
def isPalindrome(self, x: int) -> bool:
@@ -105,6 +107,8 @@ class Solution:
return x in (y, y // 10)
```
+#### Java
+
```java
class Solution {
public boolean isPalindrome(int x) {
@@ -120,6 +124,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -136,6 +142,8 @@ public:
};
```
+#### Go
+
```go
func isPalindrome(x int) bool {
if x < 0 || (x > 0 && x%10 == 0) {
@@ -149,6 +157,8 @@ func isPalindrome(x int) bool {
}
```
+#### TypeScript
+
```ts
function isPalindrome(x: number): boolean {
if (x < 0 || (x > 0 && x % 10 === 0)) {
@@ -162,6 +172,8 @@ function isPalindrome(x: number): boolean {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_palindrome(x: i32) -> bool {
@@ -185,6 +197,8 @@ impl Solution {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_palindrome(mut x: i32) -> bool {
@@ -202,6 +216,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} x
@@ -219,6 +235,8 @@ var isPalindrome = function (x) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0009.Palindrome Number/README_EN.md b/solution/0000-0099/0009.Palindrome Number/README_EN.md
index 9ba00572cd002..c980324036bf4 100644
--- a/solution/0000-0099/0009.Palindrome Number/README_EN.md
+++ b/solution/0000-0099/0009.Palindrome Number/README_EN.md
@@ -85,6 +85,8 @@ The time complexity is $O(\log_{10}(n))$, where $n$ is $x$. For each iteration,
+#### Python3
+
```python
class Solution:
def isPalindrome(self, x: int) -> bool:
@@ -97,6 +99,8 @@ class Solution:
return x in (y, y // 10)
```
+#### Java
+
```java
class Solution {
public boolean isPalindrome(int x) {
@@ -112,6 +116,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -128,6 +134,8 @@ public:
};
```
+#### Go
+
```go
func isPalindrome(x int) bool {
if x < 0 || (x > 0 && x%10 == 0) {
@@ -141,6 +149,8 @@ func isPalindrome(x int) bool {
}
```
+#### TypeScript
+
```ts
function isPalindrome(x: number): boolean {
if (x < 0 || (x > 0 && x % 10 === 0)) {
@@ -154,6 +164,8 @@ function isPalindrome(x: number): boolean {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_palindrome(x: i32) -> bool {
@@ -177,6 +189,8 @@ impl Solution {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn is_palindrome(mut x: i32) -> bool {
@@ -194,6 +208,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} x
@@ -211,6 +227,8 @@ var isPalindrome = function (x) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0010.Regular Expression Matching/README.md b/solution/0000-0099/0010.Regular Expression Matching/README.md
index 1b89d6bcfffbb..ff0ce58e0004d 100644
--- a/solution/0000-0099/0010.Regular Expression Matching/README.md
+++ b/solution/0000-0099/0010.Regular Expression Matching/README.md
@@ -86,6 +86,8 @@ tags:
+#### Python3
+
```python
class Solution:
def isMatch(self, s: str, p: str) -> bool:
@@ -103,6 +105,8 @@ class Solution:
return dfs(0, 0)
```
+#### Java
+
```java
class Solution {
private Boolean[][] f;
@@ -139,6 +143,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -169,6 +175,8 @@ public:
};
```
+#### Go
+
```go
func isMatch(s string, p string) bool {
m, n := len(s), len(p)
@@ -199,6 +207,8 @@ func isMatch(s string, p string) bool {
}
```
+#### Rust
+
```rust
impl Solution {
#[allow(dead_code)]
@@ -240,6 +250,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -272,6 +284,8 @@ var isMatch = function (s, p) {
};
```
+#### C#
+
```cs
public class Solution {
private string s;
@@ -331,6 +345,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def isMatch(self, s: str, p: str) -> bool:
@@ -348,6 +364,8 @@ class Solution:
return f[m][n]
```
+#### Java
+
```java
class Solution {
public boolean isMatch(String s, String p) {
@@ -372,6 +390,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -397,6 +417,8 @@ public:
};
```
+#### Go
+
```go
func isMatch(s string, p string) bool {
m, n := len(s), len(p)
@@ -421,6 +443,8 @@ func isMatch(s string, p string) bool {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -448,6 +472,8 @@ var isMatch = function (s, p) {
};
```
+#### C#
+
```cs
public class Solution {
public bool IsMatch(string s, string p) {
@@ -471,6 +497,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0010.Regular Expression Matching/README_EN.md b/solution/0000-0099/0010.Regular Expression Matching/README_EN.md
index 498e2cce90529..5e56d3f62511b 100644
--- a/solution/0000-0099/0010.Regular Expression Matching/README_EN.md
+++ b/solution/0000-0099/0010.Regular Expression Matching/README_EN.md
@@ -85,6 +85,8 @@ The time complexity is $O(m \times n)$, and the space complexity is $O(m \times
+#### Python3
+
```python
class Solution:
def isMatch(self, s: str, p: str) -> bool:
@@ -102,6 +104,8 @@ class Solution:
return dfs(0, 0)
```
+#### Java
+
```java
class Solution {
private Boolean[][] f;
@@ -138,6 +142,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -168,6 +174,8 @@ public:
};
```
+#### Go
+
```go
func isMatch(s string, p string) bool {
m, n := len(s), len(p)
@@ -198,6 +206,8 @@ func isMatch(s string, p string) bool {
}
```
+#### Rust
+
```rust
impl Solution {
#[allow(dead_code)]
@@ -239,6 +249,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -271,6 +283,8 @@ var isMatch = function (s, p) {
};
```
+#### C#
+
```cs
public class Solution {
private string s;
@@ -330,6 +344,8 @@ The time complexity is $O(m \times n)$, and the space complexity is $O(m \times
+#### Python3
+
```python
class Solution:
def isMatch(self, s: str, p: str) -> bool:
@@ -347,6 +363,8 @@ class Solution:
return f[m][n]
```
+#### Java
+
```java
class Solution {
public boolean isMatch(String s, String p) {
@@ -371,6 +389,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -396,6 +416,8 @@ public:
};
```
+#### Go
+
```go
func isMatch(s string, p string) bool {
m, n := len(s), len(p)
@@ -420,6 +442,8 @@ func isMatch(s string, p string) bool {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -447,6 +471,8 @@ var isMatch = function (s, p) {
};
```
+#### C#
+
```cs
public class Solution {
public bool IsMatch(string s, string p) {
@@ -470,6 +496,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0011.Container With Most Water/README.md b/solution/0000-0099/0011.Container With Most Water/README.md
index 66d733124358e..5a8a3969742f2 100644
--- a/solution/0000-0099/0011.Container With Most Water/README.md
+++ b/solution/0000-0099/0011.Container With Most Water/README.md
@@ -72,6 +72,8 @@ tags:
+#### Python3
+
```python
class Solution:
def maxArea(self, height: List[int]) -> int:
@@ -87,6 +89,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int maxArea(int[] height) {
@@ -106,6 +110,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -126,6 +132,8 @@ public:
};
```
+#### Go
+
```go
func maxArea(height []int) (ans int) {
i, j := 0, len(height)-1
@@ -142,6 +150,8 @@ func maxArea(height []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function maxArea(height: number[]): number {
let i = 0;
@@ -160,6 +170,8 @@ function maxArea(height: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn max_area(height: Vec) -> i32 {
@@ -179,6 +191,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} height
@@ -201,6 +215,8 @@ var maxArea = function (height) {
};
```
+#### C#
+
```cs
public class Solution {
public int MaxArea(int[] height) {
@@ -220,6 +236,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0011.Container With Most Water/README_EN.md b/solution/0000-0099/0011.Container With Most Water/README_EN.md
index 853e36c33a85e..459c81c5edec6 100644
--- a/solution/0000-0099/0011.Container With Most Water/README_EN.md
+++ b/solution/0000-0099/0011.Container With Most Water/README_EN.md
@@ -69,6 +69,8 @@ The time complexity is $O(n)$, where $n$ is the length of the array `height`. Th
+#### Python3
+
```python
class Solution:
def maxArea(self, height: List[int]) -> int:
@@ -84,6 +86,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int maxArea(int[] height) {
@@ -103,6 +107,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -123,6 +129,8 @@ public:
};
```
+#### Go
+
```go
func maxArea(height []int) (ans int) {
i, j := 0, len(height)-1
@@ -139,6 +147,8 @@ func maxArea(height []int) (ans int) {
}
```
+#### TypeScript
+
```ts
function maxArea(height: number[]): number {
let i = 0;
@@ -157,6 +167,8 @@ function maxArea(height: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn max_area(height: Vec) -> i32 {
@@ -176,6 +188,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} height
@@ -198,6 +212,8 @@ var maxArea = function (height) {
};
```
+#### C#
+
```cs
public class Solution {
public int MaxArea(int[] height) {
@@ -217,6 +233,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0012.Integer to Roman/README.md b/solution/0000-0099/0012.Integer to Roman/README.md
index 7d044ac88c892..df6c1d76eda54 100644
--- a/solution/0000-0099/0012.Integer to Roman/README.md
+++ b/solution/0000-0099/0012.Integer to Roman/README.md
@@ -99,6 +99,8 @@ M 1000
+#### Python3
+
```python
class Solution:
def intToRoman(self, num: int) -> str:
@@ -112,6 +114,8 @@ class Solution:
return ''.join(ans)
```
+#### Java
+
```java
class Solution {
public String intToRoman(int num) {
@@ -130,6 +134,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -148,6 +154,8 @@ public:
};
```
+#### Go
+
```go
func intToRoman(num int) string {
cs := []string{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"}
@@ -163,6 +171,8 @@ func intToRoman(num int) string {
}
```
+#### TypeScript
+
```ts
function intToRoman(num: number): string {
const cs: string[] = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];
@@ -178,6 +188,8 @@ function intToRoman(num: number): string {
}
```
+#### C#
+
```cs
public class Solution {
public string IntToRoman(int num) {
@@ -195,6 +207,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0012.Integer to Roman/README_EN.md b/solution/0000-0099/0012.Integer to Roman/README_EN.md
index c158c5b964ee5..d6d1ef4e26268 100644
--- a/solution/0000-0099/0012.Integer to Roman/README_EN.md
+++ b/solution/0000-0099/0012.Integer to Roman/README_EN.md
@@ -141,6 +141,8 @@ The time complexity is $O(m)$, and the space complexity is $O(m)$. Here, $m$ is
+#### Python3
+
```python
class Solution:
def intToRoman(self, num: int) -> str:
@@ -154,6 +156,8 @@ class Solution:
return ''.join(ans)
```
+#### Java
+
```java
class Solution {
public String intToRoman(int num) {
@@ -172,6 +176,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -190,6 +196,8 @@ public:
};
```
+#### Go
+
```go
func intToRoman(num int) string {
cs := []string{"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"}
@@ -205,6 +213,8 @@ func intToRoman(num int) string {
}
```
+#### TypeScript
+
```ts
function intToRoman(num: number): string {
const cs: string[] = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];
@@ -220,6 +230,8 @@ function intToRoman(num: number): string {
}
```
+#### C#
+
```cs
public class Solution {
public string IntToRoman(int num) {
@@ -237,6 +249,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0013.Roman to Integer/README.md b/solution/0000-0099/0013.Roman to Integer/README.md
index c2dda5de22b75..f283fcd9bcb39 100644
--- a/solution/0000-0099/0013.Roman to Integer/README.md
+++ b/solution/0000-0099/0013.Roman to Integer/README.md
@@ -106,6 +106,8 @@ M 1000
+#### Python3
+
```python
class Solution:
def romanToInt(self, s: str) -> int:
@@ -113,6 +115,8 @@ class Solution:
return sum((-1 if d[a] < d[b] else 1) * d[a] for a, b in pairwise(s)) + d[s[-1]]
```
+#### Java
+
```java
class Solution {
public int romanToInt(String s) {
@@ -133,6 +137,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -156,6 +162,8 @@ public:
};
```
+#### Go
+
```go
func romanToInt(s string) (ans int) {
d := map[byte]int{'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}
@@ -171,6 +179,8 @@ func romanToInt(s string) (ans int) {
}
```
+#### TypeScript
+
```ts
function romanToInt(s: string): number {
const d: Map = new Map([
@@ -191,6 +201,8 @@ function romanToInt(s: string): number {
}
```
+#### JavaScript
+
```js
const romanToInt = function (s) {
const d = {
@@ -211,6 +223,8 @@ const romanToInt = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public int RomanToInt(string s) {
@@ -232,6 +246,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -263,6 +279,8 @@ class Solution {
}
```
+#### Ruby
+
```rb
# @param {String} s
# @return {Integer}
diff --git a/solution/0000-0099/0013.Roman to Integer/README_EN.md b/solution/0000-0099/0013.Roman to Integer/README_EN.md
index cc3f038a5ffe0..82dd8a12f725b 100644
--- a/solution/0000-0099/0013.Roman to Integer/README_EN.md
+++ b/solution/0000-0099/0013.Roman to Integer/README_EN.md
@@ -90,6 +90,8 @@ The time complexity is $O(n)$, and the space complexity is $O(m)$. Here, $n$ and
+#### Python3
+
```python
class Solution:
def romanToInt(self, s: str) -> int:
@@ -97,6 +99,8 @@ class Solution:
return sum((-1 if d[a] < d[b] else 1) * d[a] for a, b in pairwise(s)) + d[s[-1]]
```
+#### Java
+
```java
class Solution {
public int romanToInt(String s) {
@@ -117,6 +121,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -140,6 +146,8 @@ public:
};
```
+#### Go
+
```go
func romanToInt(s string) (ans int) {
d := map[byte]int{'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000}
@@ -155,6 +163,8 @@ func romanToInt(s string) (ans int) {
}
```
+#### TypeScript
+
```ts
function romanToInt(s: string): number {
const d: Map = new Map([
@@ -175,6 +185,8 @@ function romanToInt(s: string): number {
}
```
+#### JavaScript
+
```js
const romanToInt = function (s) {
const d = {
@@ -195,6 +207,8 @@ const romanToInt = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public int RomanToInt(string s) {
@@ -216,6 +230,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -247,6 +263,8 @@ class Solution {
}
```
+#### Ruby
+
```rb
# @param {String} s
# @return {Integer}
diff --git a/solution/0000-0099/0014.Longest Common Prefix/README.md b/solution/0000-0099/0014.Longest Common Prefix/README.md
index 7e594d391a00e..7ccdfcfc11e67 100644
--- a/solution/0000-0099/0014.Longest Common Prefix/README.md
+++ b/solution/0000-0099/0014.Longest Common Prefix/README.md
@@ -63,6 +63,8 @@ tags:
+#### Python3
+
```python
class Solution:
def longestCommonPrefix(self, strs: List[str]) -> str:
@@ -73,6 +75,8 @@ class Solution:
return strs[0]
```
+#### Java
+
```java
class Solution {
public String longestCommonPrefix(String[] strs) {
@@ -89,6 +93,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -106,6 +112,8 @@ public:
};
```
+#### Go
+
```go
func longestCommonPrefix(strs []string) string {
n := len(strs)
@@ -120,6 +128,8 @@ func longestCommonPrefix(strs []string) string {
}
```
+#### TypeScript
+
```ts
function longestCommonPrefix(strs: string[]): string {
const len = strs.reduce((r, s) => Math.min(r, s.length), Infinity);
@@ -133,6 +143,8 @@ function longestCommonPrefix(strs: string[]): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn longest_common_prefix(strs: Vec) -> String {
@@ -153,6 +165,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string[]} strs
@@ -170,6 +184,8 @@ var longestCommonPrefix = function (strs) {
};
```
+#### C#
+
```cs
public class Solution {
public string LongestCommonPrefix(string[] strs) {
@@ -186,6 +202,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -207,6 +225,8 @@ class Solution {
}
```
+#### Ruby
+
```rb
# @param {String[]} strs
# @return {String}
diff --git a/solution/0000-0099/0014.Longest Common Prefix/README_EN.md b/solution/0000-0099/0014.Longest Common Prefix/README_EN.md
index 9e6b2959dde2d..823f95aba280d 100644
--- a/solution/0000-0099/0014.Longest Common Prefix/README_EN.md
+++ b/solution/0000-0099/0014.Longest Common Prefix/README_EN.md
@@ -62,6 +62,8 @@ The time complexity is $O(n \times m)$, where $n$ and $m$ are the length of the
+#### Python3
+
```python
class Solution:
def longestCommonPrefix(self, strs: List[str]) -> str:
@@ -72,6 +74,8 @@ class Solution:
return strs[0]
```
+#### Java
+
```java
class Solution {
public String longestCommonPrefix(String[] strs) {
@@ -88,6 +92,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -105,6 +111,8 @@ public:
};
```
+#### Go
+
```go
func longestCommonPrefix(strs []string) string {
n := len(strs)
@@ -119,6 +127,8 @@ func longestCommonPrefix(strs []string) string {
}
```
+#### TypeScript
+
```ts
function longestCommonPrefix(strs: string[]): string {
const len = strs.reduce((r, s) => Math.min(r, s.length), Infinity);
@@ -132,6 +142,8 @@ function longestCommonPrefix(strs: string[]): string {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn longest_common_prefix(strs: Vec) -> String {
@@ -152,6 +164,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string[]} strs
@@ -169,6 +183,8 @@ var longestCommonPrefix = function (strs) {
};
```
+#### C#
+
```cs
public class Solution {
public string LongestCommonPrefix(string[] strs) {
@@ -185,6 +201,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -206,6 +224,8 @@ class Solution {
}
```
+#### Ruby
+
```rb
# @param {String[]} strs
# @return {String}
diff --git a/solution/0000-0099/0015.3Sum/README.md b/solution/0000-0099/0015.3Sum/README.md
index d6aa85b9b7f1c..0d60c80a54ff9 100644
--- a/solution/0000-0099/0015.3Sum/README.md
+++ b/solution/0000-0099/0015.3Sum/README.md
@@ -96,6 +96,8 @@ nums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0 。
+#### Python3
+
```python
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
@@ -124,6 +126,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List> threeSum(int[] nums) {
@@ -157,6 +161,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -191,6 +197,8 @@ public:
};
```
+#### Go
+
```go
func threeSum(nums []int) (ans [][]int) {
sort.Ints(nums)
@@ -222,6 +230,8 @@ func threeSum(nums []int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function threeSum(nums: number[]): number[][] {
nums.sort((a, b) => a - b);
@@ -254,6 +264,8 @@ function threeSum(nums: number[]): number[][] {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
@@ -297,6 +309,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -333,6 +347,8 @@ var threeSum = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public IList> ThreeSum(int[] nums) {
@@ -366,6 +382,8 @@ public class Solution {
}
```
+#### Ruby
+
```rb
# @param {Integer[]} nums
# @return {Integer[][]}
@@ -397,6 +415,8 @@ def three_sum(nums)
end
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0015.3Sum/README_EN.md b/solution/0000-0099/0015.3Sum/README_EN.md
index 20ca919432320..9f84f4eceb78f 100644
--- a/solution/0000-0099/0015.3Sum/README_EN.md
+++ b/solution/0000-0099/0015.3Sum/README_EN.md
@@ -90,6 +90,8 @@ The time complexity is $O(n^2)$, and the space complexity is $O(\log n)$. The $n
+#### Python3
+
```python
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
@@ -118,6 +120,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List> threeSum(int[] nums) {
@@ -151,6 +155,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -185,6 +191,8 @@ public:
};
```
+#### Go
+
```go
func threeSum(nums []int) (ans [][]int) {
sort.Ints(nums)
@@ -216,6 +224,8 @@ func threeSum(nums []int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function threeSum(nums: number[]): number[][] {
nums.sort((a, b) => a - b);
@@ -248,6 +258,8 @@ function threeSum(nums: number[]): number[][] {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
@@ -291,6 +303,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -327,6 +341,8 @@ var threeSum = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public IList> ThreeSum(int[] nums) {
@@ -360,6 +376,8 @@ public class Solution {
}
```
+#### Ruby
+
```rb
# @param {Integer[]} nums
# @return {Integer[][]}
@@ -391,6 +409,8 @@ def three_sum(nums)
end
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0016.3Sum Closest/README.md b/solution/0000-0099/0016.3Sum Closest/README.md
index 8f829ea2ff074..36a0f1a68f585 100644
--- a/solution/0000-0099/0016.3Sum Closest/README.md
+++ b/solution/0000-0099/0016.3Sum Closest/README.md
@@ -65,6 +65,8 @@ tags:
+#### Python3
+
```python
class Solution:
def threeSumClosest(self, nums: List[int], target: int) -> int:
@@ -86,6 +88,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int threeSumClosest(int[] nums, int target) {
@@ -114,6 +118,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -138,6 +144,8 @@ public:
};
```
+#### Go
+
```go
func threeSumClosest(nums []int, target int) int {
sort.Ints(nums)
@@ -171,6 +179,8 @@ func abs(x int) int {
}
```
+#### TypeScript
+
```ts
function threeSumClosest(nums: number[], target: number): number {
nums.sort((a, b) => a - b);
@@ -198,6 +208,8 @@ function threeSumClosest(nums: number[], target: number): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -230,6 +242,8 @@ var threeSumClosest = function (nums, target) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0016.3Sum Closest/README_EN.md b/solution/0000-0099/0016.3Sum Closest/README_EN.md
index 5d5766a7c90f3..92375933a0907 100644
--- a/solution/0000-0099/0016.3Sum Closest/README_EN.md
+++ b/solution/0000-0099/0016.3Sum Closest/README_EN.md
@@ -64,6 +64,8 @@ The time complexity is $O(n^2)$, and the space complexity is $O(\log n)$. Here,
+#### Python3
+
```python
class Solution:
def threeSumClosest(self, nums: List[int], target: int) -> int:
@@ -85,6 +87,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public int threeSumClosest(int[] nums, int target) {
@@ -113,6 +117,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -137,6 +143,8 @@ public:
};
```
+#### Go
+
```go
func threeSumClosest(nums []int, target int) int {
sort.Ints(nums)
@@ -170,6 +178,8 @@ func abs(x int) int {
}
```
+#### TypeScript
+
```ts
function threeSumClosest(nums: number[], target: number): number {
nums.sort((a, b) => a - b);
@@ -197,6 +207,8 @@ function threeSumClosest(nums: number[], target: number): number {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -229,6 +241,8 @@ var threeSumClosest = function (nums, target) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0017.Letter Combinations of a Phone Number/README.md b/solution/0000-0099/0017.Letter Combinations of a Phone Number/README.md
index bb5e9515355a8..58d325892108f 100644
--- a/solution/0000-0099/0017.Letter Combinations of a Phone Number/README.md
+++ b/solution/0000-0099/0017.Letter Combinations of a Phone Number/README.md
@@ -70,6 +70,8 @@ tags:
+#### Python3
+
```python
class Solution:
def letterCombinations(self, digits: str) -> List[str]:
@@ -83,6 +85,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List letterCombinations(String digits) {
@@ -107,6 +111,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -131,6 +137,8 @@ public:
};
```
+#### Go
+
```go
func letterCombinations(digits string) []string {
ans := []string{}
@@ -153,6 +161,8 @@ func letterCombinations(digits string) []string {
}
```
+#### TypeScript
+
```ts
function letterCombinations(digits: string): string[] {
if (digits.length == 0) {
@@ -174,6 +184,8 @@ function letterCombinations(digits: string): string[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn letter_combinations(digits: String) -> Vec {
@@ -198,6 +210,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} digits
@@ -223,6 +237,8 @@ var letterCombinations = function (digits) {
};
```
+#### C#
+
```cs
public class Solution {
public IList LetterCombinations(string digits) {
@@ -261,6 +277,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def letterCombinations(self, digits: str) -> List[str]:
@@ -282,6 +300,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private final String[] d = {"abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
@@ -313,6 +333,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -340,6 +362,8 @@ public:
};
```
+#### Go
+
```go
func letterCombinations(digits string) (ans []string) {
d := []string{"abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"}
@@ -364,6 +388,8 @@ func letterCombinations(digits string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function letterCombinations(digits: string): string[] {
if (digits.length == 0) {
@@ -389,6 +415,8 @@ function letterCombinations(digits: string): string[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn letter_combinations(digits: String) -> Vec {
@@ -417,6 +445,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} digits
@@ -446,6 +476,8 @@ var letterCombinations = function (digits) {
};
```
+#### C#
+
```cs
public class Solution {
private readonly string[] d = {"abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
@@ -477,6 +509,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0017.Letter Combinations of a Phone Number/README_EN.md b/solution/0000-0099/0017.Letter Combinations of a Phone Number/README_EN.md
index d5d3e4e6ab7d5..a15369a5b20c5 100644
--- a/solution/0000-0099/0017.Letter Combinations of a Phone Number/README_EN.md
+++ b/solution/0000-0099/0017.Letter Combinations of a Phone Number/README_EN.md
@@ -66,6 +66,8 @@ The time complexity is $O(4^n)$, and the space complexity is $O(4^n)$. Here, $n$
+#### Python3
+
```python
class Solution:
def letterCombinations(self, digits: str) -> List[str]:
@@ -79,6 +81,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List letterCombinations(String digits) {
@@ -103,6 +107,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -127,6 +133,8 @@ public:
};
```
+#### Go
+
```go
func letterCombinations(digits string) []string {
ans := []string{}
@@ -149,6 +157,8 @@ func letterCombinations(digits string) []string {
}
```
+#### TypeScript
+
```ts
function letterCombinations(digits: string): string[] {
if (digits.length == 0) {
@@ -170,6 +180,8 @@ function letterCombinations(digits: string): string[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn letter_combinations(digits: String) -> Vec {
@@ -194,6 +206,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} digits
@@ -219,6 +233,8 @@ var letterCombinations = function (digits) {
};
```
+#### C#
+
```cs
public class Solution {
public IList LetterCombinations(string digits) {
@@ -257,6 +273,8 @@ The time complexity is $O(4^n)$, and the space complexity is $O(n)$. Here, $n$ i
+#### Python3
+
```python
class Solution:
def letterCombinations(self, digits: str) -> List[str]:
@@ -278,6 +296,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private final String[] d = {"abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
@@ -309,6 +329,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -336,6 +358,8 @@ public:
};
```
+#### Go
+
```go
func letterCombinations(digits string) (ans []string) {
d := []string{"abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"}
@@ -360,6 +384,8 @@ func letterCombinations(digits string) (ans []string) {
}
```
+#### TypeScript
+
```ts
function letterCombinations(digits: string): string[] {
if (digits.length == 0) {
@@ -385,6 +411,8 @@ function letterCombinations(digits: string): string[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn letter_combinations(digits: String) -> Vec {
@@ -413,6 +441,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} digits
@@ -442,6 +472,8 @@ var letterCombinations = function (digits) {
};
```
+#### C#
+
```cs
public class Solution {
private readonly string[] d = {"abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
@@ -473,6 +505,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0018.4Sum/README.md b/solution/0000-0099/0018.4Sum/README.md
index 49eeb4da00879..3e4d55c93c3fb 100644
--- a/solution/0000-0099/0018.4Sum/README.md
+++ b/solution/0000-0099/0018.4Sum/README.md
@@ -74,6 +74,8 @@ tags:
+#### Python3
+
```python
class Solution:
def fourSum(self, nums: List[int], target: int) -> List[List[int]]:
@@ -105,6 +107,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List> fourSum(int[] nums, int target) {
@@ -146,6 +150,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -188,6 +194,8 @@ public:
};
```
+#### Go
+
```go
func fourSum(nums []int, target int) (ans [][]int) {
n := len(nums)
@@ -228,6 +236,8 @@ func fourSum(nums []int, target int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function fourSum(nums: number[], target: number): number[][] {
const n = nums.length;
@@ -267,6 +277,8 @@ function fourSum(nums: number[], target: number): number[][] {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -311,6 +323,8 @@ var fourSum = function (nums, target) {
};
```
+#### C#
+
```cs
public class Solution {
public IList> FourSum(int[] nums, int target) {
@@ -352,6 +366,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0018.4Sum/README_EN.md b/solution/0000-0099/0018.4Sum/README_EN.md
index 29fc3c134e61f..737466ea8d1c8 100644
--- a/solution/0000-0099/0018.4Sum/README_EN.md
+++ b/solution/0000-0099/0018.4Sum/README_EN.md
@@ -72,6 +72,8 @@ The time complexity is $O(n^3)$, and the space complexity is $O(\log n)$. Here,
+#### Python3
+
```python
class Solution:
def fourSum(self, nums: List[int], target: int) -> List[List[int]]:
@@ -103,6 +105,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List> fourSum(int[] nums, int target) {
@@ -144,6 +148,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -186,6 +192,8 @@ public:
};
```
+#### Go
+
```go
func fourSum(nums []int, target int) (ans [][]int) {
n := len(nums)
@@ -226,6 +234,8 @@ func fourSum(nums []int, target int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function fourSum(nums: number[], target: number): number[][] {
const n = nums.length;
@@ -265,6 +275,8 @@ function fourSum(nums: number[], target: number): number[][] {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -309,6 +321,8 @@ var fourSum = function (nums, target) {
};
```
+#### C#
+
```cs
public class Solution {
public IList> FourSum(int[] nums, int target) {
@@ -350,6 +364,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0019.Remove Nth Node From End of List/README.md b/solution/0000-0099/0019.Remove Nth Node From End of List/README.md
index 59062d1daf17c..310c885f7de9a 100644
--- a/solution/0000-0099/0019.Remove Nth Node From End of List/README.md
+++ b/solution/0000-0099/0019.Remove Nth Node From End of List/README.md
@@ -73,6 +73,8 @@ tags:
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -91,6 +93,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -119,6 +123,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -149,6 +155,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -171,6 +179,8 @@ func removeNthFromEnd(head *ListNode, n int) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -200,6 +210,8 @@ function removeNthFromEnd(head: ListNode | null, n: number): ListNode | null {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -235,6 +247,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -264,6 +278,8 @@ var removeNthFromEnd = function (head, n) {
};
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
@@ -292,6 +308,8 @@ def remove_nth_from_end(head, n)
end
```
+#### PHP
+
```php
# Definition for singly-linked list.
# class ListNode {
diff --git a/solution/0000-0099/0019.Remove Nth Node From End of List/README_EN.md b/solution/0000-0099/0019.Remove Nth Node From End of List/README_EN.md
index a8185fa4b6560..c2e89d64db00c 100644
--- a/solution/0000-0099/0019.Remove Nth Node From End of List/README_EN.md
+++ b/solution/0000-0099/0019.Remove Nth Node From End of List/README_EN.md
@@ -70,6 +70,8 @@ The time complexity is $O(n)$, where $n$ is the length of the linked list. The s
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -88,6 +90,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -116,6 +120,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -146,6 +152,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -168,6 +176,8 @@ func removeNthFromEnd(head *ListNode, n int) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -197,6 +207,8 @@ function removeNthFromEnd(head: ListNode | null, n: number): ListNode | null {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -232,6 +244,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -261,6 +275,8 @@ var removeNthFromEnd = function (head, n) {
};
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
@@ -289,6 +305,8 @@ def remove_nth_from_end(head, n)
end
```
+#### PHP
+
```php
# Definition for singly-linked list.
# class ListNode {
diff --git a/solution/0000-0099/0020.Valid Parentheses/README.md b/solution/0000-0099/0020.Valid Parentheses/README.md
index ab920475436fe..4e6adcb27adec 100644
--- a/solution/0000-0099/0020.Valid Parentheses/README.md
+++ b/solution/0000-0099/0020.Valid Parentheses/README.md
@@ -79,6 +79,8 @@ tags:
+#### Python3
+
```python
class Solution:
def isValid(self, s: str) -> bool:
@@ -92,6 +94,8 @@ class Solution:
return not stk
```
+#### Java
+
```java
class Solution {
public boolean isValid(String s) {
@@ -112,6 +116,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -134,6 +140,8 @@ public:
};
```
+#### Go
+
```go
func isValid(s string) bool {
stk := []rune{}
@@ -154,6 +162,8 @@ func match(l, r rune) bool {
}
```
+#### TypeScript
+
```ts
const map = new Map([
['(', ')'],
@@ -174,6 +184,8 @@ function isValid(s: string): boolean {
}
```
+#### Rust
+
```rust
use std::collections::HashMap;
@@ -196,6 +208,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -220,6 +234,8 @@ function match(l, r) {
}
```
+#### C#
+
```cs
public class Solution {
public bool IsValid(string s) {
@@ -240,6 +256,8 @@ public class Solution {
}
```
+#### Ruby
+
```rb
# @param {String} s
# @return {Boolean}
@@ -265,6 +283,8 @@ def is_valid(s)
end
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0020.Valid Parentheses/README_EN.md b/solution/0000-0099/0020.Valid Parentheses/README_EN.md
index dfb8415484c84..427aaa6553630 100644
--- a/solution/0000-0099/0020.Valid Parentheses/README_EN.md
+++ b/solution/0000-0099/0020.Valid Parentheses/README_EN.md
@@ -77,6 +77,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
class Solution:
def isValid(self, s: str) -> bool:
@@ -90,6 +92,8 @@ class Solution:
return not stk
```
+#### Java
+
```java
class Solution {
public boolean isValid(String s) {
@@ -110,6 +114,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -132,6 +138,8 @@ public:
};
```
+#### Go
+
```go
func isValid(s string) bool {
stk := []rune{}
@@ -152,6 +160,8 @@ func match(l, r rune) bool {
}
```
+#### TypeScript
+
```ts
const map = new Map([
['(', ')'],
@@ -172,6 +182,8 @@ function isValid(s: string): boolean {
}
```
+#### Rust
+
```rust
use std::collections::HashMap;
@@ -194,6 +206,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -218,6 +232,8 @@ function match(l, r) {
}
```
+#### C#
+
```cs
public class Solution {
public bool IsValid(string s) {
@@ -238,6 +254,8 @@ public class Solution {
}
```
+#### Ruby
+
```rb
# @param {String} s
# @return {Boolean}
@@ -263,6 +281,8 @@ def is_valid(s)
end
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0021.Merge Two Sorted Lists/README.md b/solution/0000-0099/0021.Merge Two Sorted Lists/README.md
index aa15dc84aaf3e..f9e7c4440dab9 100644
--- a/solution/0000-0099/0021.Merge Two Sorted Lists/README.md
+++ b/solution/0000-0099/0021.Merge Two Sorted Lists/README.md
@@ -69,6 +69,8 @@ tags:
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -89,6 +91,8 @@ class Solution:
return list2
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -119,6 +123,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -146,6 +152,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -171,6 +179,8 @@ func mergeTwoLists(list1 *ListNode, list2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -198,6 +208,8 @@ function mergeTwoLists(list1: ListNode | null, list2: ListNode | null): ListNode
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -238,6 +250,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -265,6 +279,8 @@ var mergeTwoLists = function (list1, list2) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -301,6 +317,8 @@ public class Solution {
}
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
@@ -349,6 +367,8 @@ end
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -373,6 +393,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -404,6 +426,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -436,6 +460,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -466,6 +492,8 @@ func mergeTwoLists(list1 *ListNode, list2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -497,6 +525,8 @@ function mergeTwoLists(list1: ListNode | null, list2: ListNode | null): ListNode
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -540,6 +570,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -571,6 +603,8 @@ var mergeTwoLists = function (list1, list2) {
};
```
+#### PHP
+
```php
# Definition for singly-linked list.
# class ListNode {
diff --git a/solution/0000-0099/0021.Merge Two Sorted Lists/README_EN.md b/solution/0000-0099/0021.Merge Two Sorted Lists/README_EN.md
index 458be165c01d8..7f9d8daa39f61 100644
--- a/solution/0000-0099/0021.Merge Two Sorted Lists/README_EN.md
+++ b/solution/0000-0099/0021.Merge Two Sorted Lists/README_EN.md
@@ -71,6 +71,8 @@ The time complexity is $O(m + n)$, and the space complexity is $O(m + n)$. Here,
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -91,6 +93,8 @@ class Solution:
return list2
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -121,6 +125,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -148,6 +154,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -173,6 +181,8 @@ func mergeTwoLists(list1 *ListNode, list2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -200,6 +210,8 @@ function mergeTwoLists(list1: ListNode | null, list2: ListNode | null): ListNode
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -240,6 +252,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -267,6 +281,8 @@ var mergeTwoLists = function (list1, list2) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -303,6 +319,8 @@ public class Solution {
}
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
@@ -351,6 +369,8 @@ The time complexity is $O(m + n)$, where $m$ and $n$ are the lengths of the two
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -375,6 +395,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -406,6 +428,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -438,6 +462,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -468,6 +494,8 @@ func mergeTwoLists(list1 *ListNode, list2 *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -499,6 +527,8 @@ function mergeTwoLists(list1: ListNode | null, list2: ListNode | null): ListNode
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -542,6 +572,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -573,6 +605,8 @@ var mergeTwoLists = function (list1, list2) {
};
```
+#### PHP
+
```php
# Definition for singly-linked list.
# class ListNode {
diff --git a/solution/0000-0099/0022.Generate Parentheses/README.md b/solution/0000-0099/0022.Generate Parentheses/README.md
index cccd29d7b8704..ef5af9be22087 100644
--- a/solution/0000-0099/0022.Generate Parentheses/README.md
+++ b/solution/0000-0099/0022.Generate Parentheses/README.md
@@ -65,6 +65,8 @@ tags:
+#### Python3
+
```python
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
@@ -82,6 +84,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List ans = new ArrayList<>();
@@ -107,6 +111,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -127,6 +133,8 @@ public:
};
```
+#### Go
+
```go
func generateParenthesis(n int) (ans []string) {
var dfs func(int, int, string)
@@ -146,6 +154,8 @@ func generateParenthesis(n int) (ans []string) {
}
```
+#### TypeScript
+
```ts
function generateParenthesis(n: number): string[] {
function dfs(l, r, t) {
@@ -165,6 +175,8 @@ function generateParenthesis(n: number): string[] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(left: i32, right: i32, s: &mut String, res: &mut Vec) {
@@ -192,6 +204,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -225,6 +239,8 @@ var generateParenthesis = function (n) {
+#### Rust
+
```rust
impl Solution {
pub fn generate_parenthesis(n: i32) -> Vec {
@@ -256,6 +272,8 @@ impl Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0022.Generate Parentheses/README_EN.md b/solution/0000-0099/0022.Generate Parentheses/README_EN.md
index 0016d04ef2549..aea8581904098 100644
--- a/solution/0000-0099/0022.Generate Parentheses/README_EN.md
+++ b/solution/0000-0099/0022.Generate Parentheses/README_EN.md
@@ -56,6 +56,8 @@ The time complexity is $O(2^{n\times 2} \times n)$, and the space complexity is
+#### Python3
+
```python
class Solution:
def generateParenthesis(self, n: int) -> List[str]:
@@ -73,6 +75,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List ans = new ArrayList<>();
@@ -98,6 +102,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -118,6 +124,8 @@ public:
};
```
+#### Go
+
```go
func generateParenthesis(n int) (ans []string) {
var dfs func(int, int, string)
@@ -137,6 +145,8 @@ func generateParenthesis(n int) (ans []string) {
}
```
+#### TypeScript
+
```ts
function generateParenthesis(n: number): string[] {
function dfs(l, r, t) {
@@ -156,6 +166,8 @@ function generateParenthesis(n: number): string[] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(left: i32, right: i32, s: &mut String, res: &mut Vec) {
@@ -183,6 +195,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number} n
@@ -216,6 +230,8 @@ var generateParenthesis = function (n) {
+#### Rust
+
```rust
impl Solution {
pub fn generate_parenthesis(n: i32) -> Vec {
@@ -247,6 +263,8 @@ impl Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0023.Merge k Sorted Lists/README.md b/solution/0000-0099/0023.Merge k Sorted Lists/README.md
index a30d1dba9bf53..c07f16ad90222 100644
--- a/solution/0000-0099/0023.Merge k Sorted Lists/README.md
+++ b/solution/0000-0099/0023.Merge k Sorted Lists/README.md
@@ -78,6 +78,8 @@ tags:
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -99,6 +101,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -133,6 +137,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -170,6 +176,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -207,6 +215,8 @@ func (h *hp) Push(v any) { *h = append(*h, v.(*ListNode)) }
func (h *hp) Pop() any { a := *h; v := a[len(a)-1]; *h = a[:len(a)-1]; return v }
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -241,6 +251,8 @@ function mergeKLists(lists: Array): ListNode | null {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -290,6 +302,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -323,6 +337,8 @@ var mergeKLists = function (lists) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -358,6 +374,8 @@ public class Solution {
}
```
+#### PHP
+
```php
# Definition for singly-linked list.
class ListNode {
diff --git a/solution/0000-0099/0023.Merge k Sorted Lists/README_EN.md b/solution/0000-0099/0023.Merge k Sorted Lists/README_EN.md
index 3faf396f2bafc..c202848462f5a 100644
--- a/solution/0000-0099/0023.Merge k Sorted Lists/README_EN.md
+++ b/solution/0000-0099/0023.Merge k Sorted Lists/README_EN.md
@@ -79,6 +79,8 @@ The time complexity is $O(n \times \log k)$, and the space complexity is $O(k)$.
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -100,6 +102,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -134,6 +138,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -171,6 +177,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -208,6 +216,8 @@ func (h *hp) Push(v any) { *h = append(*h, v.(*ListNode)) }
func (h *hp) Pop() any { a := *h; v := a[len(a)-1]; *h = a[:len(a)-1]; return v }
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -242,6 +252,8 @@ function mergeKLists(lists: Array): ListNode | null {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -291,6 +303,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -324,6 +338,8 @@ var mergeKLists = function (lists) {
};
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -359,6 +375,8 @@ public class Solution {
}
```
+#### PHP
+
```php
# Definition for singly-linked list.
class ListNode {
diff --git a/solution/0000-0099/0024.Swap Nodes in Pairs/README.md b/solution/0000-0099/0024.Swap Nodes in Pairs/README.md
index 837ec9fa47f95..38a1b4904219d 100644
--- a/solution/0000-0099/0024.Swap Nodes in Pairs/README.md
+++ b/solution/0000-0099/0024.Swap Nodes in Pairs/README.md
@@ -69,6 +69,8 @@ tags:
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -86,6 +88,8 @@ class Solution:
return p
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -111,6 +115,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -137,6 +143,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -157,6 +165,8 @@ func swapPairs(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -182,6 +192,8 @@ function swapPairs(head: ListNode | null): ListNode | null {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -218,6 +230,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -242,6 +256,8 @@ var swapPairs = function (head) {
};
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
@@ -285,6 +301,8 @@ end
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -304,6 +322,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -333,6 +353,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -363,6 +385,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -385,6 +409,8 @@ func swapPairs(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -412,6 +438,8 @@ function swapPairs(head: ListNode | null): ListNode | null {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -438,6 +466,8 @@ var swapPairs = function (head) {
};
```
+#### PHP
+
```php
# Definition for singly-linked list.
# class ListNode {
diff --git a/solution/0000-0099/0024.Swap Nodes in Pairs/README_EN.md b/solution/0000-0099/0024.Swap Nodes in Pairs/README_EN.md
index 7c60fbcaa1474..9d8f91b526e06 100644
--- a/solution/0000-0099/0024.Swap Nodes in Pairs/README_EN.md
+++ b/solution/0000-0099/0024.Swap Nodes in Pairs/README_EN.md
@@ -67,6 +67,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$. Here, $n$ is
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -84,6 +86,8 @@ class Solution:
return p
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -109,6 +113,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -135,6 +141,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -155,6 +163,8 @@ func swapPairs(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -180,6 +190,8 @@ function swapPairs(head: ListNode | null): ListNode | null {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -216,6 +228,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -240,6 +254,8 @@ var swapPairs = function (head) {
};
```
+#### Ruby
+
```rb
# Definition for singly-linked list.
# class ListNode
@@ -283,6 +299,8 @@ The time complexity is $O(n)$, and the space complexity is $O(1)$. Here, $n$ is
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -302,6 +320,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -331,6 +351,8 @@ class Solution {
}
```
+#### C++
+
```cpp
/**
* Definition for singly-linked list.
@@ -361,6 +383,8 @@ public:
};
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -383,6 +407,8 @@ func swapPairs(head *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -410,6 +436,8 @@ function swapPairs(head: ListNode | null): ListNode | null {
}
```
+#### JavaScript
+
```js
/**
* Definition for singly-linked list.
@@ -436,6 +464,8 @@ var swapPairs = function (head) {
};
```
+#### PHP
+
```php
# Definition for singly-linked list.
# class ListNode {
diff --git a/solution/0000-0099/0025.Reverse Nodes in k-Group/README.md b/solution/0000-0099/0025.Reverse Nodes in k-Group/README.md
index cd9e9461f7703..fcdc139163f01 100644
--- a/solution/0000-0099/0025.Reverse Nodes in k-Group/README.md
+++ b/solution/0000-0099/0025.Reverse Nodes in k-Group/README.md
@@ -69,6 +69,8 @@ tags:
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -103,6 +105,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -149,6 +153,8 @@ class Solution {
}
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -185,6 +191,8 @@ func reverse(start, end *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -236,6 +244,8 @@ function reverse(head: ListNode, tail: ListNode) {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -294,6 +304,8 @@ impl Solution {
}
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -345,6 +357,8 @@ public class Solution {
}
```
+#### PHP
+
```php
# Definition for singly-linked list.
# class ListNode {
@@ -411,6 +425,8 @@ class Solution {
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -443,6 +459,8 @@ func reverse(start, end *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
diff --git a/solution/0000-0099/0025.Reverse Nodes in k-Group/README_EN.md b/solution/0000-0099/0025.Reverse Nodes in k-Group/README_EN.md
index 1be084898a7fe..30abf3f03033f 100644
--- a/solution/0000-0099/0025.Reverse Nodes in k-Group/README_EN.md
+++ b/solution/0000-0099/0025.Reverse Nodes in k-Group/README_EN.md
@@ -62,6 +62,8 @@ The time complexity is $O(n)$, and the space complexity is $O(1)$. Here, $n$ is
+#### Python3
+
```python
# Definition for singly-linked list.
# class ListNode:
@@ -96,6 +98,8 @@ class Solution:
return dummy.next
```
+#### Java
+
```java
/**
* Definition for singly-linked list.
@@ -142,6 +146,8 @@ class Solution {
}
```
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -178,6 +184,8 @@ func reverse(start, end *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
@@ -229,6 +237,8 @@ function reverse(head: ListNode, tail: ListNode) {
}
```
+#### Rust
+
```rust
// Definition for singly-linked list.
// #[derive(PartialEq, Eq, Clone, Debug)]
@@ -287,6 +297,8 @@ impl Solution {
}
```
+#### C#
+
```cs
/**
* Definition for singly-linked list.
@@ -338,6 +350,8 @@ public class Solution {
}
```
+#### PHP
+
```php
# Definition for singly-linked list.
# class ListNode {
@@ -404,6 +418,8 @@ The time complexity is $O(n)$, and the space complexity is $O(\log_k n)$. Here,
+#### Go
+
```go
/**
* Definition for singly-linked list.
@@ -436,6 +452,8 @@ func reverse(start, end *ListNode) *ListNode {
}
```
+#### TypeScript
+
```ts
/**
* Definition for singly-linked list.
diff --git a/solution/0000-0099/0026.Remove Duplicates from Sorted Array/README.md b/solution/0000-0099/0026.Remove Duplicates from Sorted Array/README.md
index 101f21aad0cc7..dda26e8bdaea5 100644
--- a/solution/0000-0099/0026.Remove Duplicates from Sorted Array/README.md
+++ b/solution/0000-0099/0026.Remove Duplicates from Sorted Array/README.md
@@ -100,6 +100,8 @@ for (int i = 0; i < k; i++) {
+#### Python3
+
```python
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
@@ -111,6 +113,8 @@ class Solution:
return k
```
+#### Java
+
```java
class Solution {
public int removeDuplicates(int[] nums) {
@@ -125,6 +129,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -140,6 +146,8 @@ public:
};
```
+#### Go
+
```go
func removeDuplicates(nums []int) int {
k := 0
@@ -153,6 +161,8 @@ func removeDuplicates(nums []int) int {
}
```
+#### TypeScript
+
```ts
function removeDuplicates(nums: number[]): number {
let k: number = 0;
@@ -165,6 +175,8 @@ function removeDuplicates(nums: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn remove_duplicates(nums: &mut Vec) -> i32 {
@@ -180,6 +192,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -196,6 +210,8 @@ var removeDuplicates = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int RemoveDuplicates(int[] nums) {
@@ -210,6 +226,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -238,6 +256,8 @@ class Solution {
+#### C++
+
```cpp
class Solution {
public:
diff --git a/solution/0000-0099/0026.Remove Duplicates from Sorted Array/README_EN.md b/solution/0000-0099/0026.Remove Duplicates from Sorted Array/README_EN.md
index 072abbcaf0639..8ac890d1cd1c5 100644
--- a/solution/0000-0099/0026.Remove Duplicates from Sorted Array/README_EN.md
+++ b/solution/0000-0099/0026.Remove Duplicates from Sorted Array/README_EN.md
@@ -101,6 +101,8 @@ Similar problems:
+#### Python3
+
```python
class Solution:
def removeDuplicates(self, nums: List[int]) -> int:
@@ -112,6 +114,8 @@ class Solution:
return k
```
+#### Java
+
```java
class Solution {
public int removeDuplicates(int[] nums) {
@@ -126,6 +130,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -141,6 +147,8 @@ public:
};
```
+#### Go
+
```go
func removeDuplicates(nums []int) int {
k := 0
@@ -154,6 +162,8 @@ func removeDuplicates(nums []int) int {
}
```
+#### TypeScript
+
```ts
function removeDuplicates(nums: number[]): number {
let k: number = 0;
@@ -166,6 +176,8 @@ function removeDuplicates(nums: number[]): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn remove_duplicates(nums: &mut Vec) -> i32 {
@@ -181,6 +193,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -197,6 +211,8 @@ var removeDuplicates = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public int RemoveDuplicates(int[] nums) {
@@ -211,6 +227,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -239,6 +257,8 @@ class Solution {
+#### C++
+
```cpp
class Solution {
public:
diff --git a/solution/0000-0099/0027.Remove Element/README.md b/solution/0000-0099/0027.Remove Element/README.md
index 10e7fad08f135..501d9e32b15e9 100644
--- a/solution/0000-0099/0027.Remove Element/README.md
+++ b/solution/0000-0099/0027.Remove Element/README.md
@@ -90,6 +90,8 @@ for (int i = 0; i < len; i++) {
+#### Python3
+
```python
class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
@@ -101,6 +103,8 @@ class Solution:
return k
```
+#### Java
+
```java
class Solution {
public int removeElement(int[] nums, int val) {
@@ -115,6 +119,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -130,6 +136,8 @@ public:
};
```
+#### Go
+
```go
func removeElement(nums []int, val int) int {
k := 0
@@ -143,6 +151,8 @@ func removeElement(nums []int, val int) int {
}
```
+#### TypeScript
+
```ts
function removeElement(nums: number[], val: number): number {
let k: number = 0;
@@ -155,6 +165,8 @@ function removeElement(nums: number[], val: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn remove_element(nums: &mut Vec, val: i32) -> i32 {
@@ -170,6 +182,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -187,6 +201,8 @@ var removeElement = function (nums, val) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0027.Remove Element/README_EN.md b/solution/0000-0099/0027.Remove Element/README_EN.md
index cc3f24f78a42e..e033fd507fbbd 100644
--- a/solution/0000-0099/0027.Remove Element/README_EN.md
+++ b/solution/0000-0099/0027.Remove Element/README_EN.md
@@ -94,6 +94,8 @@ The time complexity is $O(n)$ and the space complexity is $O(1)$, where $n$ is t
+#### Python3
+
```python
class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
@@ -105,6 +107,8 @@ class Solution:
return k
```
+#### Java
+
```java
class Solution {
public int removeElement(int[] nums, int val) {
@@ -119,6 +123,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -134,6 +140,8 @@ public:
};
```
+#### Go
+
```go
func removeElement(nums []int, val int) int {
k := 0
@@ -147,6 +155,8 @@ func removeElement(nums []int, val int) int {
}
```
+#### TypeScript
+
```ts
function removeElement(nums: number[], val: number): number {
let k: number = 0;
@@ -159,6 +169,8 @@ function removeElement(nums: number[], val: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn remove_element(nums: &mut Vec, val: i32) -> i32 {
@@ -174,6 +186,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -191,6 +205,8 @@ var removeElement = function (nums, val) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0028.Find the Index of the First Occurrence in a String/README.md b/solution/0000-0099/0028.Find the Index of the First Occurrence in a String/README.md
index 49687b4d29486..9e283fccefad5 100644
--- a/solution/0000-0099/0028.Find the Index of the First Occurrence in a String/README.md
+++ b/solution/0000-0099/0028.Find the Index of the First Occurrence in a String/README.md
@@ -62,6 +62,8 @@ tags:
+#### Python3
+
```python
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
@@ -72,6 +74,8 @@ class Solution:
return -1
```
+#### Java
+
```java
class Solution {
public int strStr(String haystack, String needle) {
@@ -104,6 +108,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
private:
@@ -155,6 +161,8 @@ public:
};
```
+#### Go
+
```go
func strStr(haystack string, needle string) int {
n, m := len(haystack), len(needle)
@@ -167,6 +175,8 @@ func strStr(haystack string, needle string) int {
}
```
+#### TypeScript
+
```ts
function strStr(haystack: string, needle: string): number {
const m = haystack.length;
@@ -187,6 +197,8 @@ function strStr(haystack: string, needle: string): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn str_str(haystack: String, needle: String) -> i32 {
@@ -222,6 +234,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} haystack
@@ -247,6 +261,8 @@ var strStr = function (haystack, needle) {
};
```
+#### C#
+
```cs
public class Solution {
public int StrStr(string haystack, string needle) {
@@ -264,6 +280,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -301,6 +319,8 @@ class Solution {
+#### Go
+
```go
func strStr(haystack string, needle string) int {
n, m := len(haystack), len(needle)
@@ -331,6 +351,8 @@ func strStr(haystack string, needle string) int {
}
```
+#### TypeScript
+
```ts
function strStr(haystack: string, needle: string): number {
const m = haystack.length;
diff --git a/solution/0000-0099/0028.Find the Index of the First Occurrence in a String/README_EN.md b/solution/0000-0099/0028.Find the Index of the First Occurrence in a String/README_EN.md
index d6f7d25ffd8ae..56b6f3bd1b84a 100644
--- a/solution/0000-0099/0028.Find the Index of the First Occurrence in a String/README_EN.md
+++ b/solution/0000-0099/0028.Find the Index of the First Occurrence in a String/README_EN.md
@@ -60,6 +60,8 @@ Assuming the length of the string `haystack` is $n$ and the length of the string
+#### Python3
+
```python
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
@@ -70,6 +72,8 @@ class Solution:
return -1
```
+#### Java
+
```java
class Solution {
public int strStr(String haystack, String needle) {
@@ -102,6 +106,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
private:
@@ -153,6 +159,8 @@ public:
};
```
+#### Go
+
```go
func strStr(haystack string, needle string) int {
n, m := len(haystack), len(needle)
@@ -165,6 +173,8 @@ func strStr(haystack string, needle string) int {
}
```
+#### TypeScript
+
```ts
function strStr(haystack: string, needle: string): number {
const m = haystack.length;
@@ -185,6 +195,8 @@ function strStr(haystack: string, needle: string): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn str_str(haystack: String, needle: String) -> i32 {
@@ -220,6 +232,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} haystack
@@ -245,6 +259,8 @@ var strStr = function (haystack, needle) {
};
```
+#### C#
+
```cs
public class Solution {
public int StrStr(string haystack, string needle) {
@@ -262,6 +278,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -299,6 +317,8 @@ Assuming the length of the string `haystack` is $n$ and the length of the string
+#### Go
+
```go
func strStr(haystack string, needle string) int {
n, m := len(haystack), len(needle)
@@ -329,6 +349,8 @@ func strStr(haystack string, needle string) int {
}
```
+#### TypeScript
+
```ts
function strStr(haystack: string, needle: string): number {
const m = haystack.length;
diff --git a/solution/0000-0099/0029.Divide Two Integers/README.md b/solution/0000-0099/0029.Divide Two Integers/README.md
index f0a2d9bd10bc0..a3d56bdec2352 100644
--- a/solution/0000-0099/0029.Divide Two Integers/README.md
+++ b/solution/0000-0099/0029.Divide Two Integers/README.md
@@ -66,6 +66,8 @@ tags:
+#### Python3
+
```python
class Solution:
def divide(self, a: int, b: int) -> int:
@@ -88,6 +90,8 @@ class Solution:
return ans if sign else -ans
```
+#### Java
+
```java
class Solution {
public int divide(int a, int b) {
@@ -116,6 +120,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -145,6 +151,8 @@ public:
};
```
+#### Go
+
```go
func divide(a int, b int) int {
if b == 1 {
@@ -181,6 +189,8 @@ func divide(a int, b int) int {
}
```
+#### TypeScript
+
```ts
function divide(a: number, b: number): number {
if (b === 1) {
@@ -212,6 +222,8 @@ function divide(a: number, b: number): number {
}
```
+#### C#
+
```cs
public class Solution {
public int Divide(int a, int b) {
@@ -240,6 +252,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0029.Divide Two Integers/README_EN.md b/solution/0000-0099/0029.Divide Two Integers/README_EN.md
index f393aaabda541..cb2814dff7d73 100644
--- a/solution/0000-0099/0029.Divide Two Integers/README_EN.md
+++ b/solution/0000-0099/0029.Divide Two Integers/README_EN.md
@@ -66,6 +66,8 @@ Assuming the dividend is $a$ and the divisor is $b$, the time complexity is $O(\
+#### Python3
+
```python
class Solution:
def divide(self, a: int, b: int) -> int:
@@ -88,6 +90,8 @@ class Solution:
return ans if sign else -ans
```
+#### Java
+
```java
class Solution {
public int divide(int a, int b) {
@@ -116,6 +120,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -145,6 +151,8 @@ public:
};
```
+#### Go
+
```go
func divide(a int, b int) int {
if b == 1 {
@@ -181,6 +189,8 @@ func divide(a int, b int) int {
}
```
+#### TypeScript
+
```ts
function divide(a: number, b: number): number {
if (b === 1) {
@@ -212,6 +222,8 @@ function divide(a: number, b: number): number {
}
```
+#### C#
+
```cs
public class Solution {
public int Divide(int a, int b) {
@@ -240,6 +252,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0030.Substring with Concatenation of All Words/README.md b/solution/0000-0099/0030.Substring with Concatenation of All Words/README.md
index d4e2626f7dadb..5d9bfce5f8868 100644
--- a/solution/0000-0099/0030.Substring with Concatenation of All Words/README.md
+++ b/solution/0000-0099/0030.Substring with Concatenation of All Words/README.md
@@ -90,6 +90,8 @@ s 中没有子串长度为 16 并且等于 words 的任何顺序排列的连接
+#### Python3
+
```python
class Solution:
def findSubstring(self, s: str, words: List[str]) -> List[int]:
@@ -121,6 +123,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List findSubstring(String s, String[] words) {
@@ -162,6 +166,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -203,6 +209,8 @@ public:
};
```
+#### Go
+
```go
func findSubstring(s string, words []string) (ans []int) {
cnt := map[string]int{}
@@ -237,6 +245,8 @@ func findSubstring(s string, words []string) (ans []int) {
}
```
+#### TypeScript
+
```ts
function findSubstring(s: string, words: string[]): number[] {
const cnt: Map = new Map();
@@ -278,6 +288,8 @@ function findSubstring(s: string, words: string[]): number[] {
}
```
+#### C#
+
```cs
public class Solution {
public IList FindSubstring(string s, string[] words) {
@@ -322,6 +334,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -388,6 +402,8 @@ class Solution {
+#### C++
+
```cpp
class Solution {
public:
diff --git a/solution/0000-0099/0030.Substring with Concatenation of All Words/README_EN.md b/solution/0000-0099/0030.Substring with Concatenation of All Words/README_EN.md
index 50c2f4bede7c7..02dffbb52991e 100644
--- a/solution/0000-0099/0030.Substring with Concatenation of All Words/README_EN.md
+++ b/solution/0000-0099/0030.Substring with Concatenation of All Words/README_EN.md
@@ -96,6 +96,8 @@ The time complexity is $O(m \times k)$, and the space complexity is $O(n \times
+#### Python3
+
```python
class Solution:
def findSubstring(self, s: str, words: List[str]) -> List[int]:
@@ -127,6 +129,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
public List findSubstring(String s, String[] words) {
@@ -168,6 +172,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -209,6 +215,8 @@ public:
};
```
+#### Go
+
```go
func findSubstring(s string, words []string) (ans []int) {
cnt := map[string]int{}
@@ -243,6 +251,8 @@ func findSubstring(s string, words []string) (ans []int) {
}
```
+#### TypeScript
+
```ts
function findSubstring(s: string, words: string[]): number[] {
const cnt: Map = new Map();
@@ -284,6 +294,8 @@ function findSubstring(s: string, words: string[]): number[] {
}
```
+#### C#
+
```cs
public class Solution {
public IList FindSubstring(string s, string[] words) {
@@ -328,6 +340,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
@@ -394,6 +408,8 @@ class Solution {
+#### C++
+
```cpp
class Solution {
public:
diff --git a/solution/0000-0099/0031.Next Permutation/README.md b/solution/0000-0099/0031.Next Permutation/README.md
index 256aeafb54055..bc35e97d32a66 100644
--- a/solution/0000-0099/0031.Next Permutation/README.md
+++ b/solution/0000-0099/0031.Next Permutation/README.md
@@ -83,6 +83,8 @@ tags:
+#### Python3
+
```python
class Solution:
def nextPermutation(self, nums: List[int]) -> None:
@@ -94,6 +96,8 @@ class Solution:
nums[i + 1 :] = nums[i + 1 :][::-1]
```
+#### Java
+
```java
class Solution {
public void nextPermutation(int[] nums) {
@@ -126,6 +130,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -148,6 +154,8 @@ public:
};
```
+#### Go
+
```go
func nextPermutation(nums []int) {
n := len(nums)
@@ -168,6 +176,8 @@ func nextPermutation(nums []int) {
}
```
+#### TypeScript
+
```ts
function nextPermutation(nums: number[]): void {
const n = nums.length;
@@ -189,6 +199,8 @@ function nextPermutation(nums: number[]): void {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -213,6 +225,8 @@ var nextPermutation = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public void NextPermutation(int[] nums) {
@@ -242,6 +256,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0031.Next Permutation/README_EN.md b/solution/0000-0099/0031.Next Permutation/README_EN.md
index 4ce5cf648be59..e68c6c6fefef1 100644
--- a/solution/0000-0099/0031.Next Permutation/README_EN.md
+++ b/solution/0000-0099/0031.Next Permutation/README_EN.md
@@ -81,6 +81,8 @@ The time complexity is $O(n)$ and the space complexity is $O(1)$. Where $n$ is t
+#### Python3
+
```python
class Solution:
def nextPermutation(self, nums: List[int]) -> None:
@@ -92,6 +94,8 @@ class Solution:
nums[i + 1 :] = nums[i + 1 :][::-1]
```
+#### Java
+
```java
class Solution {
public void nextPermutation(int[] nums) {
@@ -124,6 +128,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -146,6 +152,8 @@ public:
};
```
+#### Go
+
```go
func nextPermutation(nums []int) {
n := len(nums)
@@ -166,6 +174,8 @@ func nextPermutation(nums []int) {
}
```
+#### TypeScript
+
```ts
function nextPermutation(nums: number[]): void {
const n = nums.length;
@@ -187,6 +197,8 @@ function nextPermutation(nums: number[]): void {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -211,6 +223,8 @@ var nextPermutation = function (nums) {
};
```
+#### C#
+
```cs
public class Solution {
public void NextPermutation(int[] nums) {
@@ -240,6 +254,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0032.Longest Valid Parentheses/README.md b/solution/0000-0099/0032.Longest Valid Parentheses/README.md
index d970bf6f45bb1..3e346ace42bb3 100644
--- a/solution/0000-0099/0032.Longest Valid Parentheses/README.md
+++ b/solution/0000-0099/0032.Longest Valid Parentheses/README.md
@@ -89,6 +89,8 @@ $$
+#### Python3
+
```python
class Solution:
def longestValidParentheses(self, s: str) -> int:
@@ -105,6 +107,8 @@ class Solution:
return max(f)
```
+#### Java
+
```java
class Solution {
public int longestValidParentheses(String s) {
@@ -129,6 +133,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -153,6 +159,8 @@ public:
};
```
+#### Go
+
```go
func longestValidParentheses(s string) int {
n := len(s)
@@ -170,6 +178,8 @@ func longestValidParentheses(s string) int {
}
```
+#### TypeScript
+
```ts
function longestValidParentheses(s: string): number {
const n = s.length;
@@ -190,6 +200,8 @@ function longestValidParentheses(s: string): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn longest_valid_parentheses(s: String) -> i32 {
@@ -226,6 +238,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -250,6 +264,8 @@ var longestValidParentheses = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public int LongestValidParentheses(string s) {
@@ -296,6 +312,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def longestValidParentheses(self, s: str) -> int:
@@ -313,6 +331,8 @@ class Solution:
return ans
```
+#### Go
+
```go
func longestValidParentheses(s string) int {
ans := 0
@@ -335,6 +355,8 @@ func longestValidParentheses(s string) int {
}
```
+#### TypeScript
+
```ts
function longestValidParentheses(s: string): number {
let max_length: number = 0;
@@ -357,6 +379,8 @@ function longestValidParentheses(s: string): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn longest_valid_parentheses(s: String) -> i32 {
@@ -379,6 +403,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -403,6 +429,8 @@ var longestValidParentheses = function (s) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0032.Longest Valid Parentheses/README_EN.md b/solution/0000-0099/0032.Longest Valid Parentheses/README_EN.md
index 466dea2eead7d..5e644f686b175 100644
--- a/solution/0000-0099/0032.Longest Valid Parentheses/README_EN.md
+++ b/solution/0000-0099/0032.Longest Valid Parentheses/README_EN.md
@@ -87,6 +87,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$, where $n$ is
+#### Python3
+
```python
class Solution:
def longestValidParentheses(self, s: str) -> int:
@@ -103,6 +105,8 @@ class Solution:
return max(f)
```
+#### Java
+
```java
class Solution {
public int longestValidParentheses(String s) {
@@ -127,6 +131,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -151,6 +157,8 @@ public:
};
```
+#### Go
+
```go
func longestValidParentheses(s string) int {
n := len(s)
@@ -168,6 +176,8 @@ func longestValidParentheses(s string) int {
}
```
+#### TypeScript
+
```ts
function longestValidParentheses(s: string): number {
const n = s.length;
@@ -188,6 +198,8 @@ function longestValidParentheses(s: string): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn longest_valid_parentheses(s: String) -> i32 {
@@ -224,6 +236,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -248,6 +262,8 @@ var longestValidParentheses = function (s) {
};
```
+#### C#
+
```cs
public class Solution {
public int LongestValidParentheses(string s) {
@@ -295,6 +311,8 @@ The time complexity is $O(n)$, and the space complexity is $O(n)$, where $n$ is
+#### Python3
+
```python
class Solution:
def longestValidParentheses(self, s: str) -> int:
@@ -312,6 +330,8 @@ class Solution:
return ans
```
+#### Go
+
```go
func longestValidParentheses(s string) int {
ans := 0
@@ -334,6 +354,8 @@ func longestValidParentheses(s string) int {
}
```
+#### TypeScript
+
```ts
function longestValidParentheses(s: string): number {
let max_length: number = 0;
@@ -356,6 +378,8 @@ function longestValidParentheses(s: string): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn longest_valid_parentheses(s: String) -> i32 {
@@ -378,6 +402,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {string} s
@@ -402,6 +428,8 @@ var longestValidParentheses = function (s) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0033.Search in Rotated Sorted Array/README.md b/solution/0000-0099/0033.Search in Rotated Sorted Array/README.md
index 7654078d8dc31..77320242b4963 100644
--- a/solution/0000-0099/0033.Search in Rotated Sorted Array/README.md
+++ b/solution/0000-0099/0033.Search in Rotated Sorted Array/README.md
@@ -84,6 +84,8 @@ tags:
+#### Python3
+
```python
class Solution:
def search(self, nums: List[int], target: int) -> int:
@@ -104,6 +106,8 @@ class Solution:
return left if nums[left] == target else -1
```
+#### Java
+
```java
class Solution {
public int search(int[] nums, int target) {
@@ -130,6 +134,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -155,6 +161,8 @@ public:
};
```
+#### Go
+
```go
func search(nums []int, target int) int {
n := len(nums)
@@ -182,6 +190,8 @@ func search(nums []int, target int) int {
}
```
+#### TypeScript
+
```ts
function search(nums: number[], target: number): number {
const n = nums.length;
@@ -207,6 +217,8 @@ function search(nums: number[], target: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn search(nums: Vec, target: i32) -> i32 {
@@ -237,6 +249,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -267,6 +281,8 @@ var search = function (nums, target) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0033.Search in Rotated Sorted Array/README_EN.md b/solution/0000-0099/0033.Search in Rotated Sorted Array/README_EN.md
index 5b7c296c85b6a..0826fedd5b185 100644
--- a/solution/0000-0099/0033.Search in Rotated Sorted Array/README_EN.md
+++ b/solution/0000-0099/0033.Search in Rotated Sorted Array/README_EN.md
@@ -72,6 +72,8 @@ The time complexity is $O(\log n)$, where $n$ is the length of the array $nums$.
+#### Python3
+
```python
class Solution:
def search(self, nums: List[int], target: int) -> int:
@@ -92,6 +94,8 @@ class Solution:
return left if nums[left] == target else -1
```
+#### Java
+
```java
class Solution {
public int search(int[] nums, int target) {
@@ -118,6 +122,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -143,6 +149,8 @@ public:
};
```
+#### Go
+
```go
func search(nums []int, target int) int {
n := len(nums)
@@ -170,6 +178,8 @@ func search(nums []int, target int) int {
}
```
+#### TypeScript
+
```ts
function search(nums: number[], target: number): number {
const n = nums.length;
@@ -195,6 +205,8 @@ function search(nums: number[], target: number): number {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn search(nums: Vec, target: i32) -> i32 {
@@ -225,6 +237,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -255,6 +269,8 @@ var search = function (nums, target) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md
index cb9f24d4c90e1..8c5847c082f52 100644
--- a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md
+++ b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README.md
@@ -119,6 +119,8 @@ int search(int left, int right) {
+#### Python3
+
```python
class Solution:
def searchRange(self, nums: List[int], target: int) -> List[int]:
@@ -127,6 +129,8 @@ class Solution:
return [-1, -1] if l == r else [l, r - 1]
```
+#### Java
+
```java
class Solution {
public int[] searchRange(int[] nums, int target) {
@@ -150,6 +154,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -162,6 +168,8 @@ public:
};
```
+#### Go
+
```go
func searchRange(nums []int, target int) []int {
l := sort.SearchInts(nums, target)
@@ -173,6 +181,8 @@ func searchRange(nums []int, target int) []int {
}
```
+#### TypeScript
+
```ts
function searchRange(nums: number[], target: number): number[] {
const search = (x: number): number => {
@@ -193,6 +203,8 @@ function searchRange(nums: number[], target: number): number[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn search_range(nums: Vec, target: i32) -> Vec {
@@ -220,6 +232,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -246,6 +260,8 @@ var searchRange = function (nums, target) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README_EN.md b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README_EN.md
index 766fbaa51dfd6..e6488c4579ea2 100644
--- a/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README_EN.md
+++ b/solution/0000-0099/0034.Find First and Last Position of Element in Sorted Array/README_EN.md
@@ -109,6 +109,8 @@ Note that the advantage of these two templates is that they always keep the answ
+#### Python3
+
```python
class Solution:
def searchRange(self, nums: List[int], target: int) -> List[int]:
@@ -117,6 +119,8 @@ class Solution:
return [-1, -1] if l == r else [l, r - 1]
```
+#### Java
+
```java
class Solution {
public int[] searchRange(int[] nums, int target) {
@@ -140,6 +144,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -152,6 +158,8 @@ public:
};
```
+#### Go
+
```go
func searchRange(nums []int, target int) []int {
l := sort.SearchInts(nums, target)
@@ -163,6 +171,8 @@ func searchRange(nums []int, target int) []int {
}
```
+#### TypeScript
+
```ts
function searchRange(nums: number[], target: number): number[] {
const search = (x: number): number => {
@@ -183,6 +193,8 @@ function searchRange(nums: number[], target: number): number[] {
}
```
+#### Rust
+
```rust
impl Solution {
pub fn search_range(nums: Vec, target: i32) -> Vec {
@@ -210,6 +222,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -236,6 +250,8 @@ var searchRange = function (nums, target) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0035.Search Insert Position/README.md b/solution/0000-0099/0035.Search Insert Position/README.md
index adf713e2a81f3..2c01ec64fc9bb 100644
--- a/solution/0000-0099/0035.Search Insert Position/README.md
+++ b/solution/0000-0099/0035.Search Insert Position/README.md
@@ -69,6 +69,8 @@ tags:
+#### Python3
+
```python
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
@@ -82,6 +84,8 @@ class Solution:
return left
```
+#### Java
+
```java
class Solution {
public int searchInsert(int[] nums, int target) {
@@ -99,6 +103,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -116,6 +122,8 @@ public:
};
```
+#### Go
+
```go
func searchInsert(nums []int, target int) int {
left, right := 0, len(nums)
@@ -131,6 +139,8 @@ func searchInsert(nums []int, target int) int {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
impl Solution {
@@ -156,6 +166,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -191,12 +203,16 @@ var searchInsert = function (nums, target) {
+#### Python3
+
```python
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
return bisect_left(nums, target)
```
+#### Java
+
```java
class Solution {
public int searchInsert(int[] nums, int target) {
@@ -206,6 +222,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -215,12 +233,16 @@ public:
};
```
+#### Go
+
```go
func searchInsert(nums []int, target int) int {
return sort.SearchInts(nums, target)
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0035.Search Insert Position/README_EN.md b/solution/0000-0099/0035.Search Insert Position/README_EN.md
index 0c4650a8f88ba..38b3f1035fb59 100644
--- a/solution/0000-0099/0035.Search Insert Position/README_EN.md
+++ b/solution/0000-0099/0035.Search Insert Position/README_EN.md
@@ -67,6 +67,8 @@ The time complexity is $O(\log n)$, and the space complexity is $O(1)$. Here, $n
+#### Python3
+
```python
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
@@ -80,6 +82,8 @@ class Solution:
return left
```
+#### Java
+
```java
class Solution {
public int searchInsert(int[] nums, int target) {
@@ -97,6 +101,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -114,6 +120,8 @@ public:
};
```
+#### Go
+
```go
func searchInsert(nums []int, target int) int {
left, right := 0, len(nums)
@@ -129,6 +137,8 @@ func searchInsert(nums []int, target int) int {
}
```
+#### Rust
+
```rust
use std::cmp::Ordering;
impl Solution {
@@ -154,6 +164,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
/**
* @param {number[]} nums
@@ -189,12 +201,16 @@ The time complexity is $O(\log n)$, where $n$ is the length of the array $nums$.
+#### Python3
+
```python
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
return bisect_left(nums, target)
```
+#### Java
+
```java
class Solution {
public int searchInsert(int[] nums, int target) {
@@ -204,6 +220,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -213,12 +231,16 @@ public:
};
```
+#### Go
+
```go
func searchInsert(nums []int, target int) int {
return sort.SearchInts(nums, target)
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0036.Valid Sudoku/README.md b/solution/0000-0099/0036.Valid Sudoku/README.md
index 081dd5de0911b..6871ce88fc235 100644
--- a/solution/0000-0099/0036.Valid Sudoku/README.md
+++ b/solution/0000-0099/0036.Valid Sudoku/README.md
@@ -100,6 +100,8 @@ tags:
+#### Python3
+
```python
class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
@@ -121,6 +123,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
public boolean isValidSudoku(char[][] board) {
@@ -148,6 +152,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -174,6 +180,8 @@ public:
};
```
+#### Go
+
```go
func isValidSudoku(board [][]byte) bool {
row, col, sub := [9][9]bool{}, [9][9]bool{}, [9][9]bool{}
@@ -196,6 +204,8 @@ func isValidSudoku(board [][]byte) bool {
}
```
+#### TypeScript
+
```ts
function isValidSudoku(board: string[][]): boolean {
const row: boolean[][] = Array.from({ length: 9 }, () =>
@@ -226,6 +236,8 @@ function isValidSudoku(board: string[][]): boolean {
}
```
+#### JavaScript
+
```js
/**
* @param {character[][]} board
@@ -254,6 +266,8 @@ var isValidSudoku = function (board) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0036.Valid Sudoku/README_EN.md b/solution/0000-0099/0036.Valid Sudoku/README_EN.md
index 3eb28c196b6c4..8f821a0fe54bb 100644
--- a/solution/0000-0099/0036.Valid Sudoku/README_EN.md
+++ b/solution/0000-0099/0036.Valid Sudoku/README_EN.md
@@ -96,6 +96,8 @@ The time complexity is $O(C)$ and the space complexity is $O(C)$, where $C$ is t
+#### Python3
+
```python
class Solution:
def isValidSudoku(self, board: List[List[str]]) -> bool:
@@ -117,6 +119,8 @@ class Solution:
return True
```
+#### Java
+
```java
class Solution {
public boolean isValidSudoku(char[][] board) {
@@ -144,6 +148,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -170,6 +176,8 @@ public:
};
```
+#### Go
+
```go
func isValidSudoku(board [][]byte) bool {
row, col, sub := [9][9]bool{}, [9][9]bool{}, [9][9]bool{}
@@ -192,6 +200,8 @@ func isValidSudoku(board [][]byte) bool {
}
```
+#### TypeScript
+
```ts
function isValidSudoku(board: string[][]): boolean {
const row: boolean[][] = Array.from({ length: 9 }, () =>
@@ -222,6 +232,8 @@ function isValidSudoku(board: string[][]): boolean {
}
```
+#### JavaScript
+
```js
/**
* @param {character[][]} board
@@ -250,6 +262,8 @@ var isValidSudoku = function (board) {
};
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0037.Sudoku Solver/README.md b/solution/0000-0099/0037.Sudoku Solver/README.md
index 700605e63114b..cdf7fb0c4fec5 100644
--- a/solution/0000-0099/0037.Sudoku Solver/README.md
+++ b/solution/0000-0099/0037.Sudoku Solver/README.md
@@ -76,6 +76,8 @@ tags:
+#### Python3
+
```python
class Solution:
def solveSudoku(self, board: List[List[str]]) -> None:
@@ -109,6 +111,8 @@ class Solution:
dfs(0)
```
+#### Java
+
```java
class Solution {
private boolean ok;
@@ -154,6 +158,8 @@ class Solution {
}
```
+#### C++
+
```cpp
using pii = pair;
@@ -198,6 +204,8 @@ public:
};
```
+#### Go
+
```go
func solveSudoku(board [][]byte) {
var row, col [9][9]bool
@@ -237,6 +245,8 @@ func solveSudoku(board [][]byte) {
}
```
+#### C#
+
```cs
public class Solution {
public void SolveSudoku(char[][] board) {
@@ -371,6 +381,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0037.Sudoku Solver/README_EN.md b/solution/0000-0099/0037.Sudoku Solver/README_EN.md
index a8210620522f7..220e08cf5c82b 100644
--- a/solution/0000-0099/0037.Sudoku Solver/README_EN.md
+++ b/solution/0000-0099/0037.Sudoku Solver/README_EN.md
@@ -68,6 +68,8 @@ The time complexity is $O(9^{81})$, and the space complexity is $O(9^2)$.
+#### Python3
+
```python
class Solution:
def solveSudoku(self, board: List[List[str]]) -> None:
@@ -101,6 +103,8 @@ class Solution:
dfs(0)
```
+#### Java
+
```java
class Solution {
private boolean ok;
@@ -146,6 +150,8 @@ class Solution {
}
```
+#### C++
+
```cpp
using pii = pair;
@@ -190,6 +196,8 @@ public:
};
```
+#### Go
+
```go
func solveSudoku(board [][]byte) {
var row, col [9][9]bool
@@ -229,6 +237,8 @@ func solveSudoku(board [][]byte) {
}
```
+#### C#
+
```cs
public class Solution {
public void SolveSudoku(char[][] board) {
@@ -363,6 +373,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0038.Count and Say/README.md b/solution/0000-0099/0038.Count and Say/README.md
index bbb97ee67c530..1aad9b2f9d2d2 100644
--- a/solution/0000-0099/0038.Count and Say/README.md
+++ b/solution/0000-0099/0038.Count and Say/README.md
@@ -89,6 +89,8 @@ countAndSay(4) = 读 "21" = 一 个 2 + 一 个 1 = "12" + "11" = "1211"
+#### Python3
+
```python
class Solution:
def countAndSay(self, n: int) -> str:
@@ -107,6 +109,8 @@ class Solution:
return s
```
+#### Java
+
```java
class Solution {
public String countAndSay(int n) {
@@ -129,6 +133,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -150,6 +156,8 @@ public:
};
```
+#### Go
+
```go
func countAndSay(n int) string {
s := "1"
@@ -171,6 +179,8 @@ func countAndSay(n int) string {
}
```
+#### TypeScript
+
```ts
function countAndSay(n: number): string {
let s = '1';
@@ -193,6 +203,8 @@ function countAndSay(n: number): string {
}
```
+#### Rust
+
```rust
use std::iter::once;
@@ -217,6 +229,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
const countAndSay = function (n) {
let s = '1';
@@ -240,6 +254,8 @@ const countAndSay = function (n) {
};
```
+#### C#
+
```cs
using System.Text;
public class Solution {
@@ -280,6 +296,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0038.Count and Say/README_EN.md b/solution/0000-0099/0038.Count and Say/README_EN.md
index ae33d025d85b7..fc75074f1cdd4 100644
--- a/solution/0000-0099/0038.Count and Say/README_EN.md
+++ b/solution/0000-0099/0038.Count and Say/README_EN.md
@@ -89,6 +89,8 @@ Space Complexity: $O(m)$.
+#### Python3
+
```python
class Solution:
def countAndSay(self, n: int) -> str:
@@ -107,6 +109,8 @@ class Solution:
return s
```
+#### Java
+
```java
class Solution {
public String countAndSay(int n) {
@@ -129,6 +133,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -150,6 +156,8 @@ public:
};
```
+#### Go
+
```go
func countAndSay(n int) string {
s := "1"
@@ -171,6 +179,8 @@ func countAndSay(n int) string {
}
```
+#### TypeScript
+
```ts
function countAndSay(n: number): string {
let s = '1';
@@ -193,6 +203,8 @@ function countAndSay(n: number): string {
}
```
+#### Rust
+
```rust
use std::iter::once;
@@ -217,6 +229,8 @@ impl Solution {
}
```
+#### JavaScript
+
```js
const countAndSay = function (n) {
let s = '1';
@@ -240,6 +254,8 @@ const countAndSay = function (n) {
};
```
+#### C#
+
```cs
using System.Text;
public class Solution {
@@ -280,6 +296,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0039.Combination Sum/README.md b/solution/0000-0099/0039.Combination Sum/README.md
index 2ec3d2d5f2c9a..175184c930a34 100644
--- a/solution/0000-0099/0039.Combination Sum/README.md
+++ b/solution/0000-0099/0039.Combination Sum/README.md
@@ -85,6 +85,8 @@ tags:
+#### Python3
+
```python
class Solution:
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
@@ -106,6 +108,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -136,6 +140,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -163,6 +169,8 @@ public:
};
```
+#### Go
+
```go
func combinationSum(candidates []int, target int) (ans [][]int) {
sort.Ints(candidates)
@@ -187,6 +195,8 @@ func combinationSum(candidates []int, target int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function combinationSum(candidates: number[], target: number): number[][] {
candidates.sort((a, b) => a - b);
@@ -211,6 +221,8 @@ function combinationSum(candidates: number[], target: number): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(i: usize, s: i32, candidates: &Vec, t: &mut Vec, ans: &mut Vec>) {
@@ -237,6 +249,8 @@ impl Solution {
}
```
+#### C#
+
```cs
public class Solution {
private List> ans = new List>();
@@ -281,6 +295,8 @@ public class Solution {
+#### Python3
+
```python
class Solution:
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
@@ -302,6 +318,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -331,6 +349,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -357,6 +377,8 @@ public:
};
```
+#### Go
+
```go
func combinationSum(candidates []int, target int) (ans [][]int) {
sort.Ints(candidates)
@@ -380,6 +402,8 @@ func combinationSum(candidates []int, target int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function combinationSum(candidates: number[], target: number): number[][] {
candidates.sort((a, b) => a - b);
@@ -403,6 +427,8 @@ function combinationSum(candidates: number[], target: number): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(i: usize, s: i32, candidates: &Vec, t: &mut Vec, ans: &mut Vec>) {
@@ -428,6 +454,8 @@ impl Solution {
}
```
+#### C#
+
```cs
public class Solution {
private List> ans = new List>();
@@ -457,6 +485,8 @@ public class Solution {
}
```
+#### PHP
+
```php
class Solution {
/**
diff --git a/solution/0000-0099/0039.Combination Sum/README_EN.md b/solution/0000-0099/0039.Combination Sum/README_EN.md
index 6bcb4c40b73c8..0f2fb2d2206a0 100644
--- a/solution/0000-0099/0039.Combination Sum/README_EN.md
+++ b/solution/0000-0099/0039.Combination Sum/README_EN.md
@@ -85,6 +85,8 @@ Similar problems:
+#### Python3
+
```python
class Solution:
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
@@ -106,6 +108,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -136,6 +140,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -163,6 +169,8 @@ public:
};
```
+#### Go
+
```go
func combinationSum(candidates []int, target int) (ans [][]int) {
sort.Ints(candidates)
@@ -187,6 +195,8 @@ func combinationSum(candidates []int, target int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function combinationSum(candidates: number[], target: number): number[][] {
candidates.sort((a, b) => a - b);
@@ -211,6 +221,8 @@ function combinationSum(candidates: number[], target: number): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(i: usize, s: i32, candidates: &Vec, t: &mut Vec, ans: &mut Vec>) {
@@ -237,6 +249,8 @@ impl Solution {
}
```
+#### C#
+
```cs
public class Solution {
private List> ans = new List>();
@@ -281,6 +295,8 @@ The time complexity is $O(2^n \times n)$, and the space complexity is $O(n)$. He
+#### Python3
+
```python
class Solution:
def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]:
@@ -302,6 +318,8 @@ class Solution:
return ans
```
+#### Java
+
```java
class Solution {
private List> ans = new ArrayList<>();
@@ -331,6 +349,8 @@ class Solution {
}
```
+#### C++
+
```cpp
class Solution {
public:
@@ -357,6 +377,8 @@ public:
};
```
+#### Go
+
```go
func combinationSum(candidates []int, target int) (ans [][]int) {
sort.Ints(candidates)
@@ -380,6 +402,8 @@ func combinationSum(candidates []int, target int) (ans [][]int) {
}
```
+#### TypeScript
+
```ts
function combinationSum(candidates: number[], target: number): number[][] {
candidates.sort((a, b) => a - b);
@@ -403,6 +427,8 @@ function combinationSum(candidates: number[], target: number): number[][] {
}
```
+#### Rust
+
```rust
impl Solution {
fn dfs(i: usize, s: i32, candidates: &Vec