diff --git a/README.md b/README.md index 7bafcb92..ad4818e7 100755 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ |0005|Longest Palindromic Substring|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0005.Longest-Palindromic-Substring)|30.9%|Medium|| |0006|ZigZag Conversion|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0006.ZigZag-Conversion)|38.8%|Medium|| |0007|Reverse Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0007.Reverse-Integer)|26.0%|Easy|| -|0008|String to Integer (atoi)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0008.String-to-Integer-(atoi))|15.9%|Medium|| +|0008|String to Integer (atoi)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0008.String-to-Integer-atoi)|15.9%|Medium|| |0009|Palindrome Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0009.Palindrome-Number)|50.6%|Easy|| |0010|Regular Expression Matching||27.6%|Hard|| |0011|Container With Most Water|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0011.Container-With-Most-Water)|53.0%|Medium|| @@ -166,7 +166,7 @@ |0025|Reverse Nodes in k-Group|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0025.Reverse-Nodes-in-k-Group)|46.2%|Hard|| |0026|Remove Duplicates from Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0026.Remove-Duplicates-from-Sorted-Array)|47.2%|Easy|| |0027|Remove Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0027.Remove-Element)|49.8%|Easy|| -|0028|Implement strStr()|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0028.Implement-strStr())|35.6%|Easy|| +|0028|Implement strStr()|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0028.Implement-strStr)|35.6%|Easy|| |0029|Divide Two Integers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0029.Divide-Two-Integers)|17.0%|Medium|| |0030|Substring with Concatenation of All Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0030.Substring-with-Concatenation-of-All-Words)|26.7%|Hard|| |0031|Next Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0031.Next-Permutation)|34.2%|Medium|| @@ -188,7 +188,7 @@ |0047|Permutations II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0047.Permutations-II)|50.5%|Medium|| |0048|Rotate Image|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0048.Rotate-Image)|62.0%|Medium|| |0049|Group Anagrams|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0049.Group-Anagrams)|60.5%|Medium|| -|0050|Pow(x, n)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0050.Pow(x,-n))|31.3%|Medium|| +|0050|Pow(x, n)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0050.Powx-n)|31.3%|Medium|| |0051|N-Queens|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0051.N-Queens)|52.3%|Hard|| |0052|N-Queens II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0052.N-Queens-II)|62.7%|Hard|| |0053|Maximum Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0053.Maximum-Subarray)|48.1%|Easy|| @@ -207,7 +207,7 @@ |0066|Plus One|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0066.Plus-One)|42.1%|Easy|| |0067|Add Binary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0067.Add-Binary)|47.8%|Easy|| |0068|Text Justification||31.1%|Hard|| -|0069|Sqrt(x)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0069.Sqrt(x))|35.7%|Easy|| +|0069|Sqrt(x)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0069.Sqrtx)|35.7%|Easy|| |0070|Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0070.Climbing-Stairs)|49.0%|Easy|| |0071|Simplify Path|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0071.Simplify-Path)|35.3%|Medium|| |0072|Edit Distance||47.8%|Hard|| @@ -252,12 +252,12 @@ |0111|Minimum Depth of Binary Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0111.Minimum-Depth-of-Binary-Tree)|40.4%|Easy|| |0112|Path Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0112.Path-Sum)|43.1%|Easy|| |0113|Path Sum II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0113.Path-Sum-II)|50.3%|Medium|| -|0114|Flatten Binary Tree to Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0114.Flatten-Binary-Tree-to-Linked-List)|53.8%|Medium|| +|0114|Flatten Binary Tree to Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0114.Flatten-Binary-Tree-to-Linked-List)|53.9%|Medium|| |0115|Distinct Subsequences|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0115.Distinct-Subsequences)|40.4%|Hard|| -|0116|Populating Next Right Pointers in Each Node||50.6%|Medium|| +|0116|Populating Next Right Pointers in Each Node||50.7%|Medium|| |0117|Populating Next Right Pointers in Each Node II||43.0%|Medium|| -|0118|Pascal's Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0118.Pascal's-Triangle)|56.6%|Easy|| -|0119|Pascal's Triangle II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0119.Pascal's-Triangle-II)|53.1%|Easy|| +|0118|Pascal's Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0118.Pascals-Triangle)|56.6%|Easy|| +|0119|Pascal's Triangle II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0119.Pascals-Triangle-II)|53.1%|Easy|| |0120|Triangle|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0120.Triangle)|47.3%|Medium|| |0121|Best Time to Buy and Sell Stock|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0121.Best-Time-to-Buy-and-Sell-Stock)|52.1%|Easy|| |0122|Best Time to Buy and Sell Stock II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0122.Best-Time-to-Buy-and-Sell-Stock-II)|59.3%|Easy|| @@ -305,7 +305,7 @@ |0164|Maximum Gap|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0164.Maximum-Gap)|39.7%|Hard|| |0165|Compare Version Numbers||31.1%|Medium|| |0166|Fraction to Recurring Decimal||22.6%|Medium|| -|0167|Two Sum II - Input array is sorted|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0167.Two-Sum-II---Input-array-is-sorted)|56.1%|Easy|| +|0167|Two Sum II - Input array is sorted|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0167.Two-Sum-II-Input-array-is-sorted)|56.1%|Easy|| |0168|Excel Sheet Column Title|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0168.Excel-Sheet-Column-Title)|32.2%|Easy|| |0169|Majority Element|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0169.Majority-Element)|60.6%|Easy|| |0170|Two Sum III - Data structure design||35.3%|Easy|| @@ -346,7 +346,7 @@ |0205|Isomorphic Strings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0205.Isomorphic-Strings)|40.9%|Easy|| |0206|Reverse Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0206.Reverse-Linked-List)|66.5%|Easy|| |0207|Course Schedule|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0207.Course-Schedule)|44.5%|Medium|| -|0208|Implement Trie (Prefix Tree)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0208.Implement-Trie-(Prefix-Tree))|53.5%|Medium|| +|0208|Implement Trie (Prefix Tree)|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0208.Implement-Trie-Prefix-Tree)|53.5%|Medium|| |0209|Minimum Size Subarray Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0209.Minimum-Size-Subarray-Sum)|40.4%|Medium|| |0210|Course Schedule II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0210.Course-Schedule-II)|43.6%|Medium|| |0211|Design Add and Search Words Data Structure|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0211.Design-Add-and-Search-Words-Data-Structure)|41.3%|Medium|| @@ -441,11 +441,11 @@ |0300|Longest Increasing Subsequence|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0300.Longest-Increasing-Subsequence)|45.3%|Medium|| |0301|Remove Invalid Parentheses||45.2%|Hard|| |0302|Smallest Rectangle Enclosing Black Pixels||53.0%|Hard|| -|0303|Range Sum Query - Immutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0303.Range-Sum-Query---Immutable)|49.4%|Easy|| -|0304|Range Sum Query 2D - Immutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0304.Range-Sum-Query-2D---Immutable)|43.8%|Medium|| +|0303|Range Sum Query - Immutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0303.Range-Sum-Query-Immutable)|49.4%|Easy|| +|0304|Range Sum Query 2D - Immutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0304.Range-Sum-Query-2D-Immutable)|43.8%|Medium|| |0305|Number of Islands II||39.4%|Hard|| |0306|Additive Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0306.Additive-Number)|29.9%|Medium|| -|0307|Range Sum Query - Mutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0307.Range-Sum-Query---Mutable)|37.7%|Medium|| +|0307|Range Sum Query - Mutable|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0307.Range-Sum-Query-Mutable)|37.7%|Medium|| |0308|Range Sum Query 2D - Mutable||38.9%|Hard|| |0309|Best Time to Buy and Sell Stock with Cooldown|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0309.Best-Time-to-Buy-and-Sell-Stock-with-Cooldown)|48.8%|Medium|| |0310|Minimum Height Trees||35.2%|Medium|| @@ -608,7 +608,7 @@ |0467|Unique Substrings in Wraparound String||36.4%|Medium|| |0468|Validate IP Address||25.3%|Medium|| |0469|Convex Polygon||37.7%|Medium|| -|0470|Implement Rand10() Using Rand7()|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0470.Implement-Rand10()-Using-Rand7())|46.1%|Medium|| +|0470|Implement Rand10() Using Rand7()|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0470.Implement-Rand10-Using-Rand7)|46.1%|Medium|| |0471|Encode String with Shortest Length||50.0%|Hard|| |0472|Concatenated Words||44.0%|Hard|| |0473|Matchsticks to Square|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0473.Matchsticks-to-Square)|40.0%|Medium|| @@ -767,7 +767,7 @@ |0626|Exchange Seats||67.0%|Medium|| |0627|Swap Salary||78.7%|Easy|| |0628|Maximum Product of Three Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0628.Maximum-Product-of-Three-Numbers)|46.7%|Easy|| -|0629|K Inverse Pairs Array||36.1%|Hard|| +|0629|K Inverse Pairs Array||36.2%|Hard|| |0630|Course Schedule III|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0630.Course-Schedule-III)|34.9%|Hard|| |0631|Design Excel Sum Formula||33.2%|Hard|| |0632|Smallest Range Covering Elements from K Lists|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0632.Smallest-Range-Covering-Elements-from-K-Lists)|55.2%|Hard|| @@ -790,8 +790,8 @@ |0649|Dota2 Senate||39.5%|Medium|| |0650|2 Keys Keyboard||50.7%|Medium|| |0651|4 Keys Keyboard||53.3%|Medium|| -|0652|Find Duplicate Subtrees||53.7%|Medium|| -|0653|Two Sum IV - Input is a BST|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0653.Two-Sum-IV---Input-is-a-BST)|56.6%|Easy|| +|0652|Find Duplicate Subtrees||53.8%|Medium|| +|0653|Two Sum IV - Input is a BST|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0653.Two-Sum-IV-Input-is-a-BST)|56.6%|Easy|| |0654|Maximum Binary Tree||81.8%|Medium|| |0655|Print Binary Tree||56.8%|Medium|| |0656|Coin Path||30.0%|Hard|| @@ -833,7 +833,7 @@ |0692|Top K Frequent Words|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0692.Top-K-Frequent-Words)|53.5%|Medium|| |0693|Binary Number with Alternating Bits|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0693.Binary-Number-with-Alternating-Bits)|60.2%|Easy|| |0694|Number of Distinct Islands||58.5%|Medium|| -|0695|Max Area of Island|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0695.Max-Area-of-Island)|66.7%|Medium|| +|0695|Max Area of Island|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0695.Max-Area-of-Island)|66.6%|Medium|| |0696|Count Binary Substrings|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0696.Count-Binary-Substrings)|61.5%|Easy|| |0697|Degree of an Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0697.Degree-of-an-Array)|54.7%|Easy|| |0698|Partition to K Equal Sum Subsets||45.0%|Medium|| @@ -857,7 +857,7 @@ |0716|Max Stack||43.6%|Easy|| |0717|1-bit and 2-bit Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0717.1-bit-and-2-bit-Characters)|46.3%|Easy|| |0718|Maximum Length of Repeated Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0718.Maximum-Length-of-Repeated-Subarray)|50.9%|Medium|| -|0719|Find K-th Smallest Pair Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0719.Find-K-th-Smallest-Pair-Distance)|32.8%|Hard|| +|0719|Find K-th Smallest Pair Distance|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0719.Find-K-th-Smallest-Pair-Distance)|32.9%|Hard|| |0720|Longest Word in Dictionary|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0720.Longest-Word-in-Dictionary)|49.7%|Easy|| |0721|Accounts Merge|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0721.Accounts-Merge)|53.0%|Medium|| |0722|Remove Comments||36.7%|Medium|| @@ -923,7 +923,7 @@ |0782|Transform to Chessboard||47.1%|Hard|| |0783|Minimum Distance Between BST Nodes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0783.Minimum-Distance-Between-BST-Nodes)|54.6%|Easy|| |0784|Letter Case Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0784.Letter-Case-Permutation)|69.2%|Medium|| -|0785|Is Graph Bipartite?|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0785.Is-Graph-Bipartite?)|49.0%|Medium|| +|0785|Is Graph Bipartite?|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0785.Is-Graph-Bipartite)|49.0%|Medium|| |0786|K-th Smallest Prime Fraction|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0786.K-th-Smallest-Prime-Fraction)|44.7%|Hard|| |0787|Cheapest Flights Within K Stops||38.7%|Medium|| |0788|Rotated Digits||57.5%|Easy|| @@ -1155,7 +1155,7 @@ |1014|Best Sightseeing Pair||53.1%|Medium|| |1015|Smallest Integer Divisible by K||42.0%|Medium|| |1016|Binary String With Substrings Representing 1 To N||58.5%|Medium|| -|1017|Convert to Base -2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1017.Convert-to-Base--2)|59.4%|Medium|| +|1017|Convert to Base -2|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1017.Convert-to-Base-2)|59.4%|Medium|| |1018|Binary Prefix Divisible By 5|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1018.Binary-Prefix-Divisible-By-5)|47.6%|Easy|| |1019|Next Greater Node In Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1019.Next-Greater-Node-In-Linked-List)|58.4%|Medium|| |1020|Number of Enclaves|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1020.Number-of-Enclaves)|59.7%|Medium|| @@ -1220,7 +1220,7 @@ |1079|Letter Tile Possibilities|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1079.Letter-Tile-Possibilities)|76.1%|Medium|| |1080|Insufficient Nodes in Root to Leaf Paths||50.4%|Medium|| |1081|Smallest Subsequence of Distinct Characters||53.8%|Medium|| -|1082|Sales Analysis I||74.4%|Easy|| +|1082|Sales Analysis I||74.3%|Easy|| |1083|Sales Analysis II||50.9%|Easy|| |1084|Sales Analysis III||54.5%|Easy|| |1085|Sum of Digits in the Minimum Number||75.4%|Easy|| @@ -1310,7 +1310,7 @@ |1169|Invalid Transactions||30.6%|Medium|| |1170|Compare Strings by Frequency of the Smallest Character|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character)|60.5%|Medium|| |1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List)|41.5%|Medium|| -|1172|Dinner Plate Stacks||37.0%|Hard|| +|1172|Dinner Plate Stacks||36.9%|Hard|| |1173|Immediate Food Delivery I||83.0%|Easy|| |1174|Immediate Food Delivery II||62.6%|Medium|| |1175|Prime Arrangements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1175.Prime-Arrangements)|51.8%|Easy|| @@ -1424,7 +1424,7 @@ |1284|Minimum Number of Flips to Convert Binary Matrix to Zero Matrix||70.3%|Hard|| |1285|Find the Start and End Number of Continuous Ranges||87.7%|Medium|| |1286|Iterator for Combination||71.1%|Medium|| -|1287|Element Appearing More Than 25% In Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1287.Element-Appearing-More-Than-25%-In-Sorted-Array)|60.0%|Easy|| +|1287|Element Appearing More Than 25% In Sorted Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1287.Element-Appearing-More-Than-25-In-Sorted-Array)|60.0%|Easy|| |1288|Remove Covered Intervals||57.6%|Medium|| |1289|Minimum Falling Path Sum II||63.0%|Hard|| |1290|Convert Binary Number in a Linked List to Integer|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer)|81.7%|Easy|| @@ -1481,7 +1481,7 @@ |1341|Movie Rating||59.1%|Medium|| |1342|Number of Steps to Reduce a Number to Zero||85.6%|Easy|| |1343|Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold||65.5%|Medium|| -|1344|Angle Between Hands of a Clock||61.4%|Medium|| +|1344|Angle Between Hands of a Clock||61.5%|Medium|| |1345|Jump Game IV||42.2%|Hard|| |1346|Check If N and Its Double Exist||35.7%|Easy|| |1347|Minimum Number of Steps to Make Two Strings Anagram||75.0%|Medium|| @@ -1574,7 +1574,7 @@ |1434|Number of Ways to Wear Different Hats to Each Other||40.1%|Hard|| |1435|Create a Session Bar Chart||78.6%|Easy|| |1436|Destination City||77.2%|Easy|| -|1437|Check If All 1's Are at Least Length K Places Away|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1437.Check-If-All-1's-Are-at-Least-Length-K-Places-Away)|61.1%|Easy|| +|1437|Check If All 1's Are at Least Length K Places Away|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1437.Check-If-All-1s-Are-at-Least-Length-K-Places-Away)|61.1%|Easy|| |1438|Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1438.Longest-Continuous-Subarray-With-Absolute-Diff-Less-Than-or-Equal-to-Limit)|44.7%|Medium|| |1439|Find the Kth Smallest Sum of a Matrix With Sorted Rows|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1439.Find-the-Kth-Smallest-Sum-of-a-Matrix-With-Sorted-Rows)|61.1%|Hard|| |1440|Evaluate Boolean Expression||75.1%|Medium|| @@ -1660,7 +1660,7 @@ |1520|Maximum Number of Non-Overlapping Substrings||36.9%|Hard|| |1521|Find a Value of a Mysterious Function Closest to Target||44.2%|Hard|| |1522|Diameter of N-Ary Tree||70.0%|Medium|| -|1523|Count Odd Numbers in an Interval Range||54.1%|Easy|| +|1523|Count Odd Numbers in an Interval Range||54.0%|Easy|| |1524|Number of Sub-arrays With Odd Sum||40.7%|Medium|| |1525|Number of Good Ways to Split a String||68.5%|Medium|| |1526|Minimum Number of Increments on Subarrays to Form a Target Array||64.0%|Hard|| @@ -1881,7 +1881,7 @@ |1741|Find Total Time Spent by Each Employee||90.7%|Easy|| |1742|Maximum Number of Balls in a Box|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1742.Maximum-Number-of-Balls-in-a-Box)|73.2%|Easy|| |1743|Restore the Array From Adjacent Pairs||64.7%|Medium|| -|1744|Can You Eat Your Favorite Candy on Your Favorite Day?|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1744.Can-You-Eat-Your-Favorite-Candy-on-Your-Favorite-Day?)|31.3%|Medium|| +|1744|Can You Eat Your Favorite Candy on Your Favorite Day?|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1744.Can-You-Eat-Your-Favorite-Candy-on-Your-Favorite-Day)|31.3%|Medium|| |1745|Palindrome Partitioning IV||49.6%|Hard|| |1746|Maximum Subarray Sum After One Operation||61.9%|Medium|| |1747|Leetflex Banned Accounts||68.7%|Medium|| @@ -1946,7 +1946,7 @@ |1806|Minimum Number of Operations to Reinitialize a Permutation||70.7%|Medium|| |1807|Evaluate the Bracket Pairs of a String||66.3%|Medium|| |1808|Maximize Number of Nice Divisors||28.3%|Hard|| -|1809|Ad-Free Sessions||63.3%|Easy|| +|1809|Ad-Free Sessions||63.4%|Easy|| |1810|Minimum Path Cost in a Hidden Grid||54.0%|Medium|| |1811|Find Interview Candidates||67.3%|Medium|| |1812|Determine Color of a Chessboard Square||77.2%|Easy|| @@ -1974,12 +1974,12 @@ |1834|Single-Threaded CPU||34.0%|Medium|| |1835|Find XOR Sum of All Pairs Bitwise AND||56.6%|Hard|| |1836|Remove Duplicates From an Unsorted Linked List||72.6%|Medium|| -|1837|Sum of Digits in Base K||74.9%|Easy|| +|1837|Sum of Digits in Base K||74.8%|Easy|| |1838|Frequency of the Most Frequent Element||32.9%|Medium|| |1839|Longest Substring Of All Vowels in Order||47.2%|Medium|| |1840|Maximum Building Height||34.4%|Hard|| |1841|League Statistics||61.5%|Medium|| -|1842|Next Palindrome Using Same Digits||63.9%|Hard|| +|1842|Next Palindrome Using Same Digits||63.7%|Hard|| |1843|Suspicious Bank Accounts||52.3%|Medium|| |1844|Replace All Digits with Characters||80.1%|Easy|| |1845|Seat Reservation Manager||55.3%|Medium|| @@ -2027,9 +2027,9 @@ |1887|Reduction Operations to Make the Array Elements Equal||59.7%|Medium|| |1888|Minimum Number of Flips to Make the Binary String Alternating||33.7%|Medium|| |1889|Minimum Space Wasted From Packaging||29.2%|Hard|| -|1890|The Latest Login in 2020||86.9%|Easy|| -|1891|Cutting Ribbons||53.6%|Medium|| -|1892|Page Recommendations II||40.9%|Hard|| +|1890|The Latest Login in 2020||86.5%|Easy|| +|1891|Cutting Ribbons||53.5%|Medium|| +|1892|Page Recommendations II||41.0%|Hard|| |1893|Check if All the Integers in a Range Are Covered||49.0%|Easy|| |1894|Find the Student that Will Replace the Chalk||38.3%|Medium|| |1895|Largest Magic Square||49.0%|Medium|| @@ -2039,11 +2039,11 @@ |1899|Merge Triplets to Form Target Triplet||58.6%|Medium|| |1900|The Earliest and Latest Rounds Where Players Compete||48.5%|Hard|| |1901|Find a Peak Element II||65.9%|Medium|| -|1902|Depth of BST Given Insertion Order||49.1%|Medium|| -|1903|Largest Odd Number in String||55.3%|Easy|| -|1904|The Number of Full Rounds You Have Played||39.0%|Medium|| -|1905|Count Sub Islands||55.2%|Medium|| -|1906|Minimum Absolute Difference Queries||28.6%|Medium|| +|1902|Depth of BST Given Insertion Order||49.2%|Medium|| +|1903|Largest Odd Number in String||55.6%|Easy|| +|1904|The Number of Full Rounds You Have Played||39.4%|Medium|| +|1905|Count Sub Islands||55.6%|Medium|| +|1906|Minimum Absolute Difference Queries||29.9%|Medium|| |------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------| ------------------------------------------------------------------ diff --git a/ctl/models/mdrow.go b/ctl/models/mdrow.go index 8fc71e51..338ce2ee 100644 --- a/ctl/models/mdrow.go +++ b/ctl/models/mdrow.go @@ -24,11 +24,12 @@ func GenerateMdRows(solutionIds []int, mdrows []Mdrow) { } for i := 0; i < len(solutionIds); i++ { if row, ok := mdMap[solutionIds[i]]; ok { + s7 := standardizedTitle(row.QuestionTitle, row.FrontendQuestionID) mdMap[solutionIds[i]] = Mdrow{ FrontendQuestionID: row.FrontendQuestionID, - QuestionTitle: row.QuestionTitle, + QuestionTitle: strings.TrimSpace(row.QuestionTitle), QuestionTitleSlug: row.QuestionTitleSlug, - SolutionPath: fmt.Sprintf("[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/%v)", fmt.Sprintf("%04d.%v", solutionIds[i], strings.Replace(strings.TrimSpace(row.QuestionTitle), " ", "-", -1))), + SolutionPath: fmt.Sprintf("[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/%v)", fmt.Sprintf("%04d.%v", solutionIds[i], s7)), Acceptance: row.Acceptance, Difficulty: row.Difficulty, Frequency: row.Frequency, @@ -40,7 +41,7 @@ func GenerateMdRows(solutionIds []int, mdrows []Mdrow) { for i := range mdrows { mdrows[i] = Mdrow{ FrontendQuestionID: mdrows[i].FrontendQuestionID, - QuestionTitle: mdrows[i].QuestionTitle, + QuestionTitle: strings.TrimSpace(mdrows[i].QuestionTitle), QuestionTitleSlug: mdrows[i].QuestionTitleSlug, SolutionPath: mdMap[int(mdrows[i].FrontendQuestionID)].SolutionPath, Acceptance: mdrows[i].Acceptance, diff --git a/ctl/models/tagproblem.go b/ctl/models/tagproblem.go index 32d85154..b382edbb 100644 --- a/ctl/models/tagproblem.go +++ b/ctl/models/tagproblem.go @@ -115,6 +115,41 @@ func (t TagList) tableLine() string { return fmt.Sprintf("|%04d|%v|%v|%v|%v|%v|%v|%v|\n", t.FrontendQuestionID, t.QuestionTitle, t.SolutionPath, t.Difficulty, t.TimeComplexity, t.SpaceComplexity, t.Favorite, t.Acceptance) } +func standardizedTitle(orig string, frontendQuestionID int32) string { + s0 := strings.TrimSpace(orig) + s1 := strings.Replace(s0, " ", "-", -1) + s2 := strings.Replace(s1, "'", "", -1) + s3 := strings.Replace(s2, "%", "", -1) + s4 := strings.Replace(s3, "(", "", -1) + s5 := strings.Replace(s4, ")", "", -1) + s6 := strings.Replace(s5, ",", "", -1) + s7 := strings.Replace(s6, "?", "", -1) + count := 0 + // 去掉 --- 这种情况,这种情况是由于题目标题中包含 - ,左右有空格,左右一填充,造成了 ---,3 个 - + for i := 0; i < len(s7)-2; i++ { + if s7[i] == '-' && s7[i+1] == '-' && s7[i+2] == '-' { + fmt.Printf("【需要修正 --- 的标题是 %v】\n", fmt.Sprintf("%04d.%v", int(frontendQuestionID), s7)) + s7 = s7[:i+1] + s7[i+3:] + count++ + } + } + if count > 0 { + fmt.Printf("总共修正了 %v 个标题\n", count) + } + // 去掉 -- 这种情况,这种情况是由于题目标题中包含负号 - + for i := 0; i < len(s7)-2; i++ { + if s7[i] == '-' && s7[i+1] == '-' { + fmt.Printf("【需要修正 -- 的标题是 %v】\n", fmt.Sprintf("%04d.%v", int(frontendQuestionID), s7)) + s7 = s7[:i+1] + s7[i+2:] + count++ + } + } + if count > 0 { + fmt.Printf("总共修正了 %v 个标题\n", count) + } + return s7 +} + // GenerateTagMdRows define func GenerateTagMdRows(solutionIds []int, metaMap map[int]TagList, mdrows []Mdrow, internal bool) []TagList { tl := []TagList{} @@ -123,36 +158,7 @@ func GenerateTagMdRows(solutionIds []int, metaMap map[int]TagList, mdrows []Mdro tmp := TagList{} tmp.FrontendQuestionID = row.FrontendQuestionID tmp.QuestionTitle = strings.TrimSpace(row.QuestionTitle) - s1 := strings.Replace(tmp.QuestionTitle, " ", "-", -1) - s2 := strings.Replace(s1, "'", "", -1) - s3 := strings.Replace(s2, "%", "", -1) - s4 := strings.Replace(s3, "(", "", -1) - s5 := strings.Replace(s4, ")", "", -1) - s6 := strings.Replace(s5, ",", "", -1) - s7 := strings.Replace(s6, "?", "", -1) - count := 0 - // 去掉 --- 这种情况,这种情况是由于题目标题中包含 - ,左右有空格,左右一填充,造成了 ---,3 个 - - for i := 0; i < len(s7)-2; i++ { - if s7[i] == '-' && s7[i+1] == '-' && s7[i+2] == '-' { - fmt.Printf("【需要修正 --- 的标题是 %v】\n", fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7)) - s7 = s7[:i+1] + s7[i+3:] - count++ - } - } - if count > 0 { - fmt.Printf("总共修正了 %v 个标题\n", count) - } - // 去掉 -- 这种情况,这种情况是由于题目标题中包含负号 - - for i := 0; i < len(s7)-2; i++ { - if s7[i] == '-' && s7[i+1] == '-' { - fmt.Printf("【需要修正 -- 的标题是 %v】\n", fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7)) - s7 = s7[:i+1] + s7[i+2:] - count++ - } - } - if count > 0 { - fmt.Printf("总共修正了 %v 个标题\n", count) - } + s7 := standardizedTitle(row.QuestionTitle, row.FrontendQuestionID) if internal { tmp.SolutionPath = fmt.Sprintf("[Go]({{< relref \"/ChapterFour/%v/%v.md\" >}})", util.GetChpaterFourFileNum(int(row.FrontendQuestionID)), fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7)) } else { diff --git a/website/content/ChapterOne/Algorithm.md b/website/content/ChapterOne/Algorithm.md index b7970e2c..45b4f74f 100644 --- a/website/content/ChapterOne/Algorithm.md +++ b/website/content/ChapterOne/Algorithm.md @@ -23,7 +23,7 @@ weight: 2 |数论||1. 最大公约数
2. 最小公倍数
3. 分解质因数
4. 素数判定
5. 进制转换
6. 高精度计算
7. 整除问题
8. 同余问题
9. 欧拉函数
10. 扩展欧几里得
11. 置换群
12. 母函数
13. 离散变换
14. 康托展开
15. 矩阵
16. 向量
17. 线性方程组
18. 线性规划
|| |几何||1. 凸包 - Gift wrapping
2. 凸包 - Graham scan
3. 线段问题
4. 多边形和多面体相关问题
|| |NP 完全|1. 计算模型
2. P 类与 NP 类问题
3. NP 完全问题
4. NP 完全问题的近似算法
|1. 随机存取机 RAM
2. 随机存取存储程序机 RASP
3. 图灵机
4. 非确定性图灵机
5. P 类与 NP 类语言
6. 多项式时间验证
7. 多项式时间变换
8. Cook定理
9. 合取范式的可满足性问题 CNF-SAT
10. 3 元合取范式的可满足性问题 3-SAT
11. 团问题 CLIQUE
12. 顶点覆盖问题 VERTEX-COVER
13. 子集和问题 SUBSET-SUM
14. 哈密顿回路问题 HAM-CYCLE
15. 旅行售货员问题 TSP
16. 顶点覆盖问题的近似算法
17. 旅行售货员问题近似算法
18. 具有三角不等式性质的旅行售货员问题
19. 一般的旅行售货员问题
20. 集合覆盖问题的近似算法
21. 子集和问题的近似算法
22. 子集和问题的指数时间算法
23. 子集和问题的多项式时间近似格式
|| -|位运算| 位操作包括:
1. 取反(NOT)
2. 按位或(OR)
3. 按位异或(XOR)
4. 按位与(AND)
5. 移位: 是一个二元运算符,用来将一个二进制数中的每一位全部都向一个方向移动指定位,溢出的部分将被舍弃,而空缺的部分填入一定的值。
| 1.数字范围按位与
2.UTF-8 编码验证
3.数字转换为十六进制数
4.找出最长的超赞子字符串
5.数组异或操作
6.幂集
7.位1的个数
8.二进制表示中质数个计算置位
9.子数组异或查询
| [力扣:位运算](https://leetcode-cn.com/tag/bit-manipulation/) +|位运算| 位操作包括:
1. 取反(NOT)
2. 按位或(OR)
3. 按位异或(XOR)
4. 按位与(AND)
5. 移位: 是一个二元运算符,用来将一个二进制数中的每一位全部都向一个方向移动指定位,溢出的部分将被舍弃,而空缺的部分填入一定的值。
| 1.数字范围按位与
2.UTF-8 编码验证
3.数字转换为十六进制数
4.找出最长的超赞子字符串
5.数组异或操作
6.幂集
7.位1的个数
8.二进制表示中质数个计算置位
9.子数组异或查询
| [力扣:位运算](https://leetcode-cn.com/tag/bit-manipulation/)| |------------|------------------------------------------------------------------|-----------------------------------------------------------------|--------------------| diff --git a/website/content/ChapterTwo/Binary_Indexed_Tree.md b/website/content/ChapterTwo/Binary_Indexed_Tree.md index c2dca9e9..8af546cc 100644 --- a/website/content/ChapterTwo/Binary_Indexed_Tree.md +++ b/website/content/ChapterTwo/Binary_Indexed_Tree.md @@ -11,7 +11,7 @@ weight: 19 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | |0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard||||37.1%| -|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium||||37.6%| +|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium||||37.7%| |0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.3%| |0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||36.3%| |0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard||||27.7%| diff --git a/website/content/ChapterTwo/Breadth_First_Search.md b/website/content/ChapterTwo/Breadth_First_Search.md index 4aa49b9e..2e00e5cc 100644 --- a/website/content/ChapterTwo/Breadth_First_Search.md +++ b/website/content/ChapterTwo/Breadth_First_Search.md @@ -28,7 +28,7 @@ weight: 10 |0529|Minesweeper|[Go]({{< relref "/ChapterFour/0500~0599/0529.Minesweeper.md" >}})|Medium||||62.1%| |0542|01 Matrix|[Go]({{< relref "/ChapterFour/0500~0599/0542.01-Matrix.md" >}})|Medium| O(n)| O(1)||41.5%| |0690|Employee Importance|[Go]({{< relref "/ChapterFour/0600~0699/0690.Employee-Importance.md" >}})|Easy||||59.8%| -|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||49.1%| +|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||49.0%| |0815|Bus Routes|[Go]({{< relref "/ChapterFour/0800~0899/0815.Bus-Routes.md" >}})|Hard||||43.8%| |0863|All Nodes Distance K in Binary Tree|[Go]({{< relref "/ChapterFour/0800~0899/0863.All-Nodes-Distance-K-in-Binary-Tree.md" >}})|Medium||||58.7%| |0864|Shortest Path to Get All Keys|[Go]({{< relref "/ChapterFour/0800~0899/0864.Shortest-Path-to-Get-All-Keys.md" >}})|Hard||||42.8%| diff --git a/website/content/ChapterTwo/Depth_First_Search.md b/website/content/ChapterTwo/Depth_First_Search.md index 817c8f7c..dd5af80c 100644 --- a/website/content/ChapterTwo/Depth_First_Search.md +++ b/website/content/ChapterTwo/Depth_First_Search.md @@ -59,7 +59,7 @@ weight: 9 |0756|Pyramid Transition Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0756.Pyramid-Transition-Matrix.md" >}})|Medium||||55.9%| |0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||55.3%| |0783|Minimum Distance Between BST Nodes|[Go]({{< relref "/ChapterFour/0700~0799/0783.Minimum-Distance-Between-BST-Nodes.md" >}})|Easy||||54.6%| -|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||49.1%| +|0785|Is Graph Bipartite?|[Go]({{< relref "/ChapterFour/0700~0799/0785.Is-Graph-Bipartite.md" >}})|Medium||||49.0%| |0802|Find Eventual Safe States|[Go]({{< relref "/ChapterFour/0800~0899/0802.Find-Eventual-Safe-States.md" >}})|Medium||||50.5%| |0834|Sum of Distances in Tree|[Go]({{< relref "/ChapterFour/0800~0899/0834.Sum-of-Distances-in-Tree.md" >}})|Hard||||47.3%| |0839|Similar String Groups|[Go]({{< relref "/ChapterFour/0800~0899/0839.Similar-String-Groups.md" >}})|Hard||||42.6%| diff --git a/website/content/ChapterTwo/Segment_Tree.md b/website/content/ChapterTwo/Segment_Tree.md index 6dd9a2f4..40d79d86 100644 --- a/website/content/ChapterTwo/Segment_Tree.md +++ b/website/content/ChapterTwo/Segment_Tree.md @@ -38,7 +38,7 @@ weight: 18 | No. | Title | Solution | Difficulty | TimeComplexity | SpaceComplexity |Favorite| Acceptance | |:--------:|:------- | :--------: | :----------: | :----: | :-----: | :-----: |:-----: | |0218|The Skyline Problem|[Go]({{< relref "/ChapterFour/0200~0299/0218.The-Skyline-Problem.md" >}})|Hard| O(n log n)| O(n)|❤️|37.1%| -|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium| O(1)| O(n)||37.6%| +|0307|Range Sum Query - Mutable|[Go]({{< relref "/ChapterFour/0300~0399/0307.Range-Sum-Query-Mutable.md" >}})|Medium| O(1)| O(n)||37.7%| |0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard| O(n log n)| O(n)||42.3%| |0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard| O(n log n)| O(n)|❤️|36.3%| |0493|Reverse Pairs|[Go]({{< relref "/ChapterFour/0400~0499/0493.Reverse-Pairs.md" >}})|Hard| O(n log n)| O(n)||27.7%|