mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 08:27:30 +08:00
update solution 0031 & 0048
This commit is contained in:
90
README.md
90
README.md
@ -127,10 +127,10 @@
|
||||
| | Easy | Medium | Hard | Total |
|
||||
|:--------:|:--------:|:--------:|:--------:|:--------:|
|
||||
|Optimizing|33|44|30|107|
|
||||
|Accepted|**278**|**424**|**125**|**827**|
|
||||
|Accepted|**279**|**424**|**125**|**828**|
|
||||
|Total|523|1099|439|2061|
|
||||
|Perfection Rate|88.1%|89.6%|76.0%|87.1%|
|
||||
|Completion Rate|53.2%|38.6%|28.5%|40.1%|
|
||||
|Perfection Rate|88.2%|89.6%|76.0%|87.1%|
|
||||
|Completion Rate|53.3%|38.6%|28.5%|40.2%|
|
||||
|------------|----------------------------|----------------------------|----------------------------|----------------------------|
|
||||
|
||||
## 二. 目录
|
||||
@ -462,7 +462,7 @@
|
||||
|0321|Create Maximum Number||27.9%|Hard||
|
||||
|0322|Coin Change|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0322.Coin-Change)|39.0%|Medium||
|
||||
|0323|Number of Connected Components in an Undirected Graph||59.8%|Medium||
|
||||
|0324|Wiggle Sort II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0324.Wiggle-Sort-II)|31.6%|Medium||
|
||||
|0324|Wiggle Sort II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0324.Wiggle-Sort-II)|31.5%|Medium||
|
||||
|0325|Maximum Size Subarray Sum Equals k||48.5%|Medium||
|
||||
|0326|Power of Three|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0326.Power-of-Three)|42.9%|Easy||
|
||||
|0327|Count of Range Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0327.Count-of-Range-Sum)|36.0%|Hard||
|
||||
@ -489,7 +489,7 @@
|
||||
|0348|Design Tic-Tac-Toe||56.7%|Medium||
|
||||
|0349|Intersection of Two Arrays|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0349.Intersection-of-Two-Arrays)|67.5%|Easy||
|
||||
|0350|Intersection of Two Arrays II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0350.Intersection-of-Two-Arrays-II)|53.8%|Easy||
|
||||
|0351|Android Unlock Patterns||50.4%|Medium||
|
||||
|0351|Android Unlock Patterns||50.5%|Medium||
|
||||
|0352|Data Stream as Disjoint Intervals|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0352.Data-Stream-as-Disjoint-Intervals)|49.8%|Hard||
|
||||
|0353|Design Snake Game||37.3%|Medium||
|
||||
|0354|Russian Doll Envelopes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0354.Russian-Doll-Envelopes)|39.2%|Hard||
|
||||
@ -524,7 +524,7 @@
|
||||
|0383|Ransom Note||54.7%|Easy||
|
||||
|0384|Shuffle an Array||55.9%|Medium||
|
||||
|0385|Mini Parser|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0385.Mini-Parser)|35.3%|Medium||
|
||||
|0386|Lexicographical Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0386.Lexicographical-Numbers)|56.9%|Medium||
|
||||
|0386|Lexicographical Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0386.Lexicographical-Numbers)|57.0%|Medium||
|
||||
|0387|First Unique Character in a String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0387.First-Unique-Character-in-a-String)|55.6%|Easy||
|
||||
|0388|Longest Absolute File Path||44.7%|Medium||
|
||||
|0389|Find the Difference|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0389.Find-the-Difference)|58.8%|Easy||
|
||||
@ -644,7 +644,7 @@
|
||||
|0503|Next Greater Element II|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0503.Next-Greater-Element-II)|60.7%|Medium||
|
||||
|0504|Base 7||47.1%|Easy||
|
||||
|0505|The Maze II||50.4%|Medium||
|
||||
|0506|Relative Ranks||54.3%|Easy||
|
||||
|0506|Relative Ranks||54.4%|Easy||
|
||||
|0507|Perfect Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0507.Perfect-Number)|37.2%|Easy||
|
||||
|0508|Most Frequent Subtree Sum|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0508.Most-Frequent-Subtree-Sum)|61.4%|Medium||
|
||||
|0509|Fibonacci Number|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0509.Fibonacci-Number)|67.8%|Easy||
|
||||
@ -882,7 +882,7 @@
|
||||
|0741|Cherry Pickup||35.9%|Hard||
|
||||
|0742|Closest Leaf in a Binary Tree||44.8%|Medium||
|
||||
|0743|Network Delay Time||47.1%|Medium||
|
||||
|0744|Find Smallest Letter Greater Than Target|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0744.Find-Smallest-Letter-Greater-Than-Target)|45.9%|Easy||
|
||||
|0744|Find Smallest Letter Greater Than Target|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0744.Find-Smallest-Letter-Greater-Than-Target)|45.8%|Easy||
|
||||
|0745|Prefix and Suffix Search|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0745.Prefix-and-Suffix-Search)|35.7%|Hard||
|
||||
|0746|Min Cost Climbing Stairs|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0746.Min-Cost-Climbing-Stairs)|55.9%|Easy||
|
||||
|0747|Largest Number At Least Twice of Others||44.3%|Easy||
|
||||
@ -1032,7 +1032,7 @@
|
||||
|0891|Sum of Subsequence Widths|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0891.Sum-of-Subsequence-Widths)|33.9%|Hard||
|
||||
|0892|Surface Area of 3D Shapes|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0892.Surface-Area-of-3D-Shapes)|60.9%|Easy||
|
||||
|0893|Groups of Special-Equivalent Strings||70.1%|Medium||
|
||||
|0894|All Possible Full Binary Trees||78.9%|Medium||
|
||||
|0894|All Possible Full Binary Trees||78.8%|Medium||
|
||||
|0895|Maximum Frequency Stack|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0895.Maximum-Frequency-Stack)|64.2%|Hard||
|
||||
|0896|Monotonic Array|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0896.Monotonic-Array)|58.1%|Easy||
|
||||
|0897|Increasing Order Search Tree|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/0897.Increasing-Order-Search-Tree)|75.6%|Easy||
|
||||
@ -1210,22 +1210,22 @@
|
||||
|1069|Product Sales Analysis II||83.0%|Easy||
|
||||
|1070|Product Sales Analysis III||49.8%|Medium||
|
||||
|1071|Greatest Common Divisor of Strings||51.8%|Easy||
|
||||
|1072|Flip Columns For Maximum Number of Equal Rows||62.7%|Medium||
|
||||
|1072|Flip Columns For Maximum Number of Equal Rows||62.6%|Medium||
|
||||
|1073|Adding Two Negabinary Numbers|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1073.Adding-Two-Negabinary-Numbers)|34.9%|Medium||
|
||||
|1074|Number of Submatrices That Sum to Target|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1074.Number-of-Submatrices-That-Sum-to-Target)|65.9%|Hard||
|
||||
|1075|Project Employees I||66.7%|Easy||
|
||||
|1076|Project Employees II||52.1%|Easy||
|
||||
|1076|Project Employees II||52.0%|Easy||
|
||||
|1077|Project Employees III||78.7%|Medium||
|
||||
|1078|Occurrences After Bigram|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1078.Occurrences-After-Bigram)|64.4%|Easy||
|
||||
|1079|Letter Tile Possibilities|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1079.Letter-Tile-Possibilities)|76.2%|Medium||
|
||||
|1080|Insufficient Nodes in Root to Leaf Paths||51.0%|Medium||
|
||||
|1081|Smallest Subsequence of Distinct Characters||54.5%|Medium||
|
||||
|1082|Sales Analysis I||75.0%|Easy||
|
||||
|1082|Sales Analysis I||74.9%|Easy||
|
||||
|1083|Sales Analysis II||50.7%|Easy||
|
||||
|1084|Sales Analysis III||54.0%|Easy||
|
||||
|1085|Sum of Digits in the Minimum Number||75.4%|Easy||
|
||||
|1086|High Five||75.9%|Easy||
|
||||
|1087|Brace Expansion||63.9%|Medium||
|
||||
|1087|Brace Expansion||64.0%|Medium||
|
||||
|1088|Confusing Number II||46.4%|Hard||
|
||||
|1089|Duplicate Zeros|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1089.Duplicate-Zeros)|51.2%|Easy||
|
||||
|1090|Largest Values From Labels||60.4%|Medium||
|
||||
@ -1290,7 +1290,7 @@
|
||||
|1149|Article Views II||48.2%|Medium||
|
||||
|1150|Check If a Number Is Majority Element in a Sorted Array||56.9%|Easy||
|
||||
|1151|Minimum Swaps to Group All 1's Together||59.0%|Medium||
|
||||
|1152|Analyze User Website Visit Pattern||43.3%|Medium||
|
||||
|1152|Analyze User Website Visit Pattern||43.2%|Medium||
|
||||
|1153|String Transforms Into Another String||35.4%|Hard||
|
||||
|1154|Day of the Year|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1154.Day-of-the-Year)|50.7%|Easy||
|
||||
|1155|Number of Dice Rolls With Target Sum||47.5%|Medium||
|
||||
@ -1309,7 +1309,7 @@
|
||||
|1168|Optimize Water Distribution in a Village||62.7%|Hard||
|
||||
|1169|Invalid Transactions||30.2%|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.8%|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)|42.0%|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)|42.1%|Medium||
|
||||
|1172|Dinner Plate Stacks||35.7%|Hard||
|
||||
|1173|Immediate Food Delivery I||83.3%|Easy||
|
||||
|1174|Immediate Food Delivery II||63.3%|Medium||
|
||||
@ -1329,7 +1329,7 @@
|
||||
|1188|Design Bounded Blocking Queue||73.2%|Medium||
|
||||
|1189|Maximum Number of Balloons|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1189.Maximum-Number-of-Balloons)|62.5%|Easy||
|
||||
|1190|Reverse Substrings Between Each Pair of Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1190.Reverse-Substrings-Between-Each-Pair-of-Parentheses)|65.3%|Medium||
|
||||
|1191|K-Concatenation Maximum Sum||24.2%|Medium||
|
||||
|1191|K-Concatenation Maximum Sum||24.3%|Medium||
|
||||
|1192|Critical Connections in a Network||51.9%|Hard||
|
||||
|1193|Monthly Transactions I||68.2%|Medium||
|
||||
|1194|Tournament Winners||52.5%|Hard||
|
||||
@ -1450,7 +1450,7 @@
|
||||
|1309|Decrypt String from Alphabet to Integer Mapping||77.8%|Easy||
|
||||
|1310|XOR Queries of a Subarray|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1310.XOR-Queries-of-a-Subarray)|70.7%|Medium||
|
||||
|1311|Get Watched Videos by Your Friends||44.7%|Medium||
|
||||
|1312|Minimum Insertion Steps to Make a String Palindrome||61.9%|Hard||
|
||||
|1312|Minimum Insertion Steps to Make a String Palindrome||62.0%|Hard||
|
||||
|1313|Decompress Run-Length Encoded List|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1313.Decompress-Run-Length-Encoded-List)|85.7%|Easy||
|
||||
|1314|Matrix Block Sum||74.6%|Medium||
|
||||
|1315|Sum of Nodes with Even-Valued Grandparent||84.8%|Medium||
|
||||
@ -1485,7 +1485,7 @@
|
||||
|1344|Angle Between Hands of a Clock||62.2%|Medium||
|
||||
|1345|Jump Game IV||42.1%|Hard||
|
||||
|1346|Check If N and Its Double Exist||35.5%|Easy||
|
||||
|1347|Minimum Number of Steps to Make Two Strings Anagram||75.4%|Medium||
|
||||
|1347|Minimum Number of Steps to Make Two Strings Anagram||75.5%|Medium||
|
||||
|1348|Tweet Counts Per Frequency||41.6%|Medium||
|
||||
|1349|Maximum Students Taking Exam||45.8%|Hard||
|
||||
|1350|Students With Invalid Departments||90.5%|Easy||
|
||||
@ -1506,7 +1506,7 @@
|
||||
|1365|How Many Numbers Are Smaller Than the Current Number||86.0%|Easy||
|
||||
|1366|Rank Teams by Votes||58.3%|Medium||
|
||||
|1367|Linked List in Binary Tree||42.2%|Medium||
|
||||
|1368|Minimum Cost to Make at Least One Valid Path in a Grid||59.5%|Hard||
|
||||
|1368|Minimum Cost to Make at Least One Valid Path in a Grid||59.6%|Hard||
|
||||
|1369|Get the Second Most Recent Activity||69.4%|Hard||
|
||||
|1370|Increasing Decreasing String||77.8%|Easy||
|
||||
|1371|Find the Longest Substring Containing Vowels in Even Counts||61.9%|Medium||
|
||||
@ -1538,12 +1538,12 @@
|
||||
|1397|Find All Good Strings||39.5%|Hard||
|
||||
|1398|Customers Who Bought Products A and B but Not C||80.2%|Medium||
|
||||
|1399|Count Largest Group||66.1%|Easy||
|
||||
|1400|Construct K Palindrome Strings||64.0%|Medium||
|
||||
|1400|Construct K Palindrome Strings||64.1%|Medium||
|
||||
|1401|Circle and Rectangle Overlapping||43.3%|Medium||
|
||||
|1402|Reducing Dishes||72.4%|Hard||
|
||||
|1403|Minimum Subsequence in Non-Increasing Order||72.0%|Easy||
|
||||
|1404|Number of Steps to Reduce a Number in Binary Representation to One||50.5%|Medium||
|
||||
|1405|Longest Happy String||54.5%|Medium||
|
||||
|1405|Longest Happy String||54.4%|Medium||
|
||||
|1406|Stone Game III||60.1%|Hard||
|
||||
|1407|Top Travellers||83.9%|Easy||
|
||||
|1408|String Matching in an Array||63.7%|Easy||
|
||||
@ -1639,7 +1639,7 @@
|
||||
|1498|Number of Subsequences That Satisfy the Given Sum Condition||39.2%|Medium||
|
||||
|1499|Max Value of Equation||46.6%|Hard||
|
||||
|1500|Design a File Sharing System||46.0%|Medium||
|
||||
|1501|Countries You Can Safely Invest In||59.3%|Medium||
|
||||
|1501|Countries You Can Safely Invest In||59.2%|Medium||
|
||||
|1502|Can Make Arithmetic Progression From Sequence||70.3%|Easy||
|
||||
|1503|Last Moment Before All Ants Fall Out of a Plank||54.3%|Medium||
|
||||
|1504|Count Submatrices With All Ones||60.1%|Medium||
|
||||
@ -1687,16 +1687,16 @@
|
||||
|1546|Maximum Number of Non-Overlapping Subarrays With Sum Equals Target||45.5%|Medium||
|
||||
|1547|Minimum Cost to Cut a Stick||54.4%|Hard||
|
||||
|1548|The Most Similar Path in a Graph||56.7%|Hard||
|
||||
|1549|The Most Recent Orders for Each Product||67.9%|Medium||
|
||||
|1549|The Most Recent Orders for Each Product||68.0%|Medium||
|
||||
|1550|Three Consecutive Odds||64.1%|Easy||
|
||||
|1551|Minimum Operations to Make Array Equal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1551.Minimum-Operations-to-Make-Array-Equal)|80.7%|Medium||
|
||||
|1551|Minimum Operations to Make Array Equal|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1551.Minimum-Operations-to-Make-Array-Equal)|80.6%|Medium||
|
||||
|1552|Magnetic Force Between Two Balls||52.4%|Medium||
|
||||
|1553|Minimum Number of Days to Eat N Oranges||32.0%|Hard||
|
||||
|1554|Strings Differ by One Character||65.3%|Medium||
|
||||
|1555|Bank Account Summary||53.8%|Medium||
|
||||
|1556|Thousand Separator||57.0%|Easy||
|
||||
|1557|Minimum Number of Vertices to Reach All Nodes||77.1%|Medium||
|
||||
|1558|Minimum Numbers of Function Calls to Make Target Array||63.8%|Medium||
|
||||
|1558|Minimum Numbers of Function Calls to Make Target Array||63.7%|Medium||
|
||||
|1559|Detect Cycles in 2D Grid||46.9%|Medium||
|
||||
|1560|Most Visited Sector in a Circular Track||57.7%|Easy||
|
||||
|1561|Maximum Number of Coins You Can Get||77.9%|Medium||
|
||||
@ -1749,7 +1749,7 @@
|
||||
|1608|Special Array With X Elements Greater Than or Equal X|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1608.Special-Array-With-X-Elements-Greater-Than-or-Equal-X)|60.9%|Easy||
|
||||
|1609|Even Odd Tree||52.5%|Medium||
|
||||
|1610|Maximum Number of Visible Points||34.6%|Hard||
|
||||
|1611|Minimum One Bit Operations to Make Integers Zero||61.6%|Hard||
|
||||
|1611|Minimum One Bit Operations to Make Integers Zero||61.5%|Hard||
|
||||
|1612|Check If Two Expression Trees are Equivalent||69.1%|Medium||
|
||||
|1613|Find the Missing IDs||76.3%|Medium||
|
||||
|1614|Maximum Nesting Depth of the Parentheses|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1614.Maximum-Nesting-Depth-of-the-Parentheses)|82.8%|Easy||
|
||||
@ -1760,7 +1760,7 @@
|
||||
|1619|Mean of Array After Removing Some Elements|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1619.Mean-of-Array-After-Removing-Some-Elements)|64.6%|Easy||
|
||||
|1620|Coordinate With Maximum Network Quality||36.8%|Medium||
|
||||
|1621|Number of Sets of K Non-Overlapping Line Segments||42.6%|Medium||
|
||||
|1622|Fancy Sequence||15.1%|Hard||
|
||||
|1622|Fancy Sequence||15.2%|Hard||
|
||||
|1623|All Valid Triplets That Can Represent a Country||88.5%|Easy||
|
||||
|1624|Largest Substring Between Two Equal Characters|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1624.Largest-Substring-Between-Two-Equal-Characters)|59.0%|Easy||
|
||||
|1625|Lexicographically Smallest String After Applying Operations||66.1%|Medium||
|
||||
@ -1846,7 +1846,7 @@
|
||||
|1705|Maximum Number of Eaten Apples||35.1%|Medium||
|
||||
|1706|Where Will the Ball Fall||65.7%|Medium||
|
||||
|1707|Maximum XOR With an Element From Array||42.5%|Hard||
|
||||
|1708|Largest Subarray Length K||63.8%|Easy||
|
||||
|1708|Largest Subarray Length K||63.9%|Easy||
|
||||
|1709|Biggest Window Between Visits||79.8%|Medium||
|
||||
|1710|Maximum Units on a Truck|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1710.Maximum-Units-on-a-Truck)|72.1%|Easy||
|
||||
|1711|Count Good Meals||27.7%|Medium||
|
||||
@ -1869,7 +1869,7 @@
|
||||
|1728|Cat and Mouse II||41.4%|Hard||
|
||||
|1729|Find Followers Count||71.0%|Easy||
|
||||
|1730|Shortest Path to Get Food||54.3%|Medium||
|
||||
|1731|The Number of Employees Which Report to Each Employee||49.0%|Easy||
|
||||
|1731|The Number of Employees Which Report to Each Employee||48.9%|Easy||
|
||||
|1732|Find the Highest Altitude|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1732.Find-the-Highest-Altitude)|79.1%|Easy||
|
||||
|1733|Minimum Number of People to Teach||39.8%|Medium||
|
||||
|1734|Decode XORed Permutation|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1734.Decode-XORed-Permutation)|58.8%|Medium||
|
||||
@ -1895,7 +1895,7 @@
|
||||
|1754|Largest Merge Of Two Strings||42.7%|Medium||
|
||||
|1755|Closest Subsequence Sum||36.0%|Hard||
|
||||
|1756|Design Most Recently Used Queue||77.7%|Medium||
|
||||
|1757|Recyclable and Low Fat Products||95.7%|Easy||
|
||||
|1757|Recyclable and Low Fat Products||95.8%|Easy||
|
||||
|1758|Minimum Changes To Make Alternating Binary String|[Go](https://github.com/halfrost/LeetCode-Go/tree/master/leetcode/1758.Minimum-Changes-To-Make-Alternating-Binary-String)|58.9%|Easy||
|
||||
|1759|Count Number of Homogenous Substrings||44.7%|Medium||
|
||||
|1760|Minimum Limit of Balls in a Bag||55.3%|Medium||
|
||||
@ -1927,14 +1927,14 @@
|
||||
|1786|Number of Restricted Paths From First to Last Node||37.3%|Medium||
|
||||
|1787|Make the XOR of All Segments Equal to Zero||38.3%|Hard||
|
||||
|1788|Maximize the Beauty of the Garden||67.5%|Hard||
|
||||
|1789|Primary Department for Each Employee||80.1%|Easy||
|
||||
|1789|Primary Department for Each Employee||80.0%|Easy||
|
||||
|1790|Check if One String Swap Can Make Strings Equal||45.1%|Easy||
|
||||
|1791|Find Center of Star Graph||83.9%|Easy||
|
||||
|1792|Maximum Average Pass Ratio||49.6%|Medium||
|
||||
|1793|Maximum Score of a Good Subarray||50.1%|Hard||
|
||||
|1794|Count Pairs of Equal Substrings With Minimum Difference||65.3%|Medium||
|
||||
|1795|Rearrange Products Table||90.3%|Easy||
|
||||
|1796|Second Largest Digit in a String||48.4%|Easy||
|
||||
|1796|Second Largest Digit in a String||48.3%|Easy||
|
||||
|1797|Design Authentication Manager||51.3%|Medium||
|
||||
|1798|Maximum Number of Consecutive Values You Can Make||49.9%|Medium||
|
||||
|1799|Maximize Score After N Operations||46.4%|Hard||
|
||||
@ -1991,7 +1991,7 @@
|
||||
|1850|Minimum Adjacent Swaps to Reach the Kth Smallest Number||73.4%|Medium||
|
||||
|1851|Minimum Interval to Include Each Query||44.7%|Hard||
|
||||
|1852|Distinct Numbers in Each Subarray||74.5%|Medium||
|
||||
|1853|Convert Date Format||88.8%|Easy||
|
||||
|1853|Convert Date Format||88.9%|Easy||
|
||||
|1854|Maximum Population Year||58.0%|Easy||
|
||||
|1855|Maximum Distance Between a Pair of Values||47.6%|Medium||
|
||||
|1856|Maximum Subarray Min-Product||34.1%|Medium||
|
||||
@ -2068,7 +2068,7 @@
|
||||
|1927|Sum Game||46.8%|Medium||
|
||||
|1928|Minimum Cost to Reach Destination in Time||35.5%|Hard||
|
||||
|1929|Concatenation of Array||92.0%|Easy||
|
||||
|1930|Unique Length-3 Palindromic Subsequences||50.0%|Medium||
|
||||
|1930|Unique Length-3 Palindromic Subsequences||49.9%|Medium||
|
||||
|1931|Painting a Grid With Three Different Colors||56.2%|Hard||
|
||||
|1932|Merge BSTs to Create Single BST||33.6%|Hard||
|
||||
|1933|Check if String Is Decomposable Into Value-Equal Substrings||53.6%|Easy||
|
||||
@ -2094,7 +2094,7 @@
|
||||
|1953|Maximum Number of Weeks for Which You Can Work||35.5%|Medium||
|
||||
|1954|Minimum Garden Perimeter to Collect Enough Apples||52.0%|Medium||
|
||||
|1955|Count Number of Special Subsequences||50.3%|Hard||
|
||||
|1956|Minimum Time For K Virus Variants to Spread||42.5%|Hard||
|
||||
|1956|Minimum Time For K Virus Variants to Spread||42.6%|Hard||
|
||||
|1957|Delete Characters to Make Fancy String||55.2%|Easy||
|
||||
|1958|Check if Move is Legal||42.2%|Medium||
|
||||
|1959|Minimum Total Space Wasted With K Resizing Operations||41.0%|Medium||
|
||||
@ -2103,14 +2103,14 @@
|
||||
|1962|Remove Stones to Minimize the Total||54.2%|Medium||
|
||||
|1963|Minimum Number of Swaps to Make the String Balanced||64.6%|Medium||
|
||||
|1964|Find the Longest Valid Obstacle Course at Each Position||43.5%|Hard||
|
||||
|1965|Employees With Missing Information||82.7%|Easy||
|
||||
|1965|Employees With Missing Information||82.8%|Easy||
|
||||
|1966|Binary Searchable Numbers in an Unsorted Array||66.2%|Medium||
|
||||
|1967|Number of Strings That Appear as Substrings in Word||78.2%|Easy||
|
||||
|1968|Array With Elements Not Equal to Average of Neighbors||47.4%|Medium||
|
||||
|1969|Minimum Non-Zero Product of the Array Elements||31.6%|Medium||
|
||||
|1970|Last Day Where You Can Still Cross||47.8%|Hard||
|
||||
|1971|Find if Path Exists in Graph||50.1%|Easy||
|
||||
|1972|First and Last Call On the Same Day||52.9%|Hard||
|
||||
|1972|First and Last Call On the Same Day||53.0%|Hard||
|
||||
|1973|Count Nodes Equal to Sum of Descendants||75.1%|Medium||
|
||||
|1974|Minimum Time to Type Word Using Special Typewriter||72.5%|Easy||
|
||||
|1975|Maximum Matrix Sum||43.3%|Medium||
|
||||
@ -2121,16 +2121,16 @@
|
||||
|1980|Find Unique Binary String||61.6%|Medium||
|
||||
|1981|Minimize the Difference Between Target and Chosen Elements||32.5%|Medium||
|
||||
|1982|Find Array Given Subset Sums||46.0%|Hard||
|
||||
|1983|Widest Pair of Indices With Equal Range Sum||55.6%|Medium||
|
||||
|1983|Widest Pair of Indices With Equal Range Sum||55.7%|Medium||
|
||||
|1984|Minimum Difference Between Highest and Lowest of K Scores||54.1%|Easy||
|
||||
|1985|Find the Kth Largest Integer in the Array||43.7%|Medium||
|
||||
|1986|Minimum Number of Work Sessions to Finish the Tasks||30.8%|Medium||
|
||||
|1986|Minimum Number of Work Sessions to Finish the Tasks||30.9%|Medium||
|
||||
|1987|Number of Unique Good Subsequences||50.8%|Hard||
|
||||
|1988|Find Cutoff Score for Each School||72.3%|Medium||
|
||||
|1989|Maximum Number of People That Can Be Caught in Tag||57.8%|Medium||
|
||||
|1990|Count the Number of Experiments||52.2%|Medium||
|
||||
|1991|Find the Middle Index in Array||64.7%|Easy||
|
||||
|1992|Find All Groups of Farmland||65.3%|Medium||
|
||||
|1992|Find All Groups of Farmland||65.4%|Medium||
|
||||
|1993|Operations on Tree||39.7%|Medium||
|
||||
|1994|The Number of Good Subsets||32.0%|Hard||
|
||||
|1995|Count Special Quadruplets||56.1%|Easy||
|
||||
@ -2142,7 +2142,7 @@
|
||||
|2001|Number of Pairs of Interchangeable Rectangles||41.2%|Medium||
|
||||
|2002|Maximum Product of the Length of Two Palindromic Subsequences||50.9%|Medium||
|
||||
|2003|Smallest Missing Genetic Value in Each Subtree||40.8%|Hard||
|
||||
|2004|The Number of Seniors and Juniors to Join the Company||40.9%|Hard||
|
||||
|2004|The Number of Seniors and Juniors to Join the Company||41.0%|Hard||
|
||||
|2005|Subtree Removal Game with Fibonacci Tree||66.5%|Hard||
|
||||
|2006|Count Number of Pairs With Absolute Difference K||84.1%|Easy||
|
||||
|2007|Find Original Array From Doubled Array||33.2%|Medium||
|
||||
@ -2159,7 +2159,7 @@
|
||||
|2018|Check if Word Can Be Placed In Crossword||46.4%|Medium||
|
||||
|2019|The Score of Students Solving Math Expression||31.5%|Hard||
|
||||
|2020|Number of Accounts That Did Not Stream||72.4%|Medium||
|
||||
|2021|Brightest Position on Street||67.3%|Medium||
|
||||
|2021|Brightest Position on Street||67.2%|Medium||
|
||||
|2022|Convert 1D Array Into 2D Array||61.6%|Easy||
|
||||
|2023|Number of Pairs of Strings With Concatenation Equal to Target||73.2%|Medium||
|
||||
|2024|Maximize the Confusion of an Exam||53.0%|Medium||
|
||||
@ -2184,12 +2184,12 @@
|
||||
|2043|Simple Bank System||64.0%|Medium||
|
||||
|2044|Count Number of Maximum Bitwise-OR Subsets||74.6%|Medium||
|
||||
|2045|Second Minimum Time to Reach Destination||34.9%|Hard||
|
||||
|2046|Sort Linked List Already Sorted Using Absolute Values||73.4%|Medium||
|
||||
|2046|Sort Linked List Already Sorted Using Absolute Values||73.1%|Medium||
|
||||
|2047|Number of Valid Words in a Sentence||27.9%|Easy||
|
||||
|2048|Next Greater Numerically Balanced Number||45.3%|Medium||
|
||||
|2049|Count Nodes With the Highest Score||45.4%|Medium||
|
||||
|2050|Parallel Courses III||60.1%|Hard||
|
||||
|2051|The Category of Each Member in the Store||77.4%|Medium||
|
||||
|2051|The Category of Each Member in the Store||77.5%|Medium||
|
||||
|2052|Minimum Cost to Separate Sentence Into Rows||55.1%|Medium||
|
||||
|2053|Kth Distinct String in an Array||74.8%|Easy||
|
||||
|2054|Two Best Non-Overlapping Events||37.7%|Medium||
|
||||
@ -2199,7 +2199,7 @@
|
||||
|2058|Find the Minimum and Maximum Number of Nodes Between Critical Points||59.0%|Medium||
|
||||
|2059|Minimum Operations to Convert Number||44.2%|Medium||
|
||||
|2060|Check if an Original String Exists Given Two Encoded Strings||31.0%|Hard||
|
||||
|2061|Number of Spaces Cleaning Robot Cleaned||64.9%|Medium||
|
||||
|2061|Number of Spaces Cleaning Robot Cleaned||64.3%|Medium||
|
||||
|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
@ -1,14 +1,43 @@
|
||||
// https://leetcode.com/problems/next-permutation/discuss/1554932/Go-Submission-with-Explanation
|
||||
// Time O(N) , Space: O(1)
|
||||
|
||||
package leetcode
|
||||
|
||||
// [2,(3),6,5,4,1] -> 2,(4),6,5,(3),1 -> 2,4, 1,3,5,6
|
||||
// 解法一
|
||||
func nextPermutation(nums []int) {
|
||||
i, j := 0, 0
|
||||
for i = len(nums) - 2; i >= 0; i-- {
|
||||
if nums[i] < nums[i+1] {
|
||||
break
|
||||
}
|
||||
}
|
||||
if i >= 0 {
|
||||
for j = len(nums) - 1; j > i; j-- {
|
||||
if nums[j] > nums[i] {
|
||||
break
|
||||
}
|
||||
}
|
||||
swap(&nums, i, j)
|
||||
}
|
||||
reverse(&nums, i+1, len(nums)-1)
|
||||
}
|
||||
|
||||
func reverse(nums *[]int, i, j int) {
|
||||
for i < j {
|
||||
swap(nums, i, j)
|
||||
i++
|
||||
j--
|
||||
}
|
||||
}
|
||||
|
||||
func swap(nums *[]int, i, j int) {
|
||||
(*nums)[i], (*nums)[j] = (*nums)[j], (*nums)[i]
|
||||
}
|
||||
|
||||
// 解法二
|
||||
// [2,(3),6,5,4,1] -> 2,(4),6,5,(3),1 -> 2,4, 1,3,5,6
|
||||
func nextPermutation1(nums []int) {
|
||||
var n = len(nums)
|
||||
var pIdx = checkPermutationPossibility(nums)
|
||||
if pIdx == -1 {
|
||||
reverse(nums, 0, n-1)
|
||||
reverse(&nums, 0, n-1)
|
||||
return
|
||||
}
|
||||
|
||||
@ -16,26 +45,14 @@ func nextPermutation(nums []int) {
|
||||
// start from right most to leftward,find the first number which is larger than PIVOT
|
||||
for rp > 0 {
|
||||
if nums[rp] > nums[pIdx] {
|
||||
swap(nums, pIdx, rp)
|
||||
swap(&nums, pIdx, rp)
|
||||
break
|
||||
} else {
|
||||
rp--
|
||||
}
|
||||
}
|
||||
// Finally, Reverse all elements which are right from pivot
|
||||
reverse(nums, pIdx+1, n-1)
|
||||
}
|
||||
|
||||
func swap(nums []int, i, j int) {
|
||||
nums[i], nums[j] = nums[j], nums[i]
|
||||
}
|
||||
|
||||
func reverse(nums []int, s int, e int) {
|
||||
for s < e {
|
||||
swap(nums, s, e)
|
||||
s++
|
||||
e--
|
||||
}
|
||||
reverse(&nums, pIdx+1, n-1)
|
||||
}
|
||||
|
||||
// checkPermutationPossibility returns 1st occurrence Index where
|
||||
|
@ -1,8 +1,24 @@
|
||||
// Time: O(N) Space: O(1)
|
||||
|
||||
package leetcode
|
||||
|
||||
// 解法一
|
||||
func rotate(matrix [][]int) {
|
||||
length := len(matrix)
|
||||
// rotate by diagonal 对角线变换
|
||||
for i := 0; i < length; i++ {
|
||||
for j := i + 1; j < length; j++ {
|
||||
matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]
|
||||
}
|
||||
}
|
||||
// rotate by vertical centerline 竖直轴对称翻转
|
||||
for i := 0; i < length; i++ {
|
||||
for j := 0; j < length/2; j++ {
|
||||
matrix[i][j], matrix[i][length-j-1] = matrix[i][length-j-1], matrix[i][j]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 解法二
|
||||
func rotate1(matrix [][]int) {
|
||||
n := len(matrix)
|
||||
if n == 1 {
|
||||
return
|
||||
|
@ -57,6 +57,7 @@ Output: [1]
|
||||
```go
|
||||
package leetcode
|
||||
|
||||
// 解法一
|
||||
func nextPermutation(nums []int) {
|
||||
i, j := 0, 0
|
||||
for i = len(nums) - 2; i >= 0; i-- {
|
||||
@ -86,6 +87,47 @@ func reverse(nums *[]int, i, j int) {
|
||||
func swap(nums *[]int, i, j int) {
|
||||
(*nums)[i], (*nums)[j] = (*nums)[j], (*nums)[i]
|
||||
}
|
||||
|
||||
// 解法二
|
||||
// [2,(3),6,5,4,1] -> 2,(4),6,5,(3),1 -> 2,4, 1,3,5,6
|
||||
func nextPermutation1(nums []int) {
|
||||
var n = len(nums)
|
||||
var pIdx = checkPermutationPossibility(nums)
|
||||
if pIdx == -1 {
|
||||
reverse(&nums, 0, n-1)
|
||||
return
|
||||
}
|
||||
|
||||
var rp = len(nums) - 1
|
||||
// start from right most to leftward,find the first number which is larger than PIVOT
|
||||
for rp > 0 {
|
||||
if nums[rp] > nums[pIdx] {
|
||||
swap(&nums, pIdx, rp)
|
||||
break
|
||||
} else {
|
||||
rp--
|
||||
}
|
||||
}
|
||||
// Finally, Reverse all elements which are right from pivot
|
||||
reverse(&nums, pIdx+1, n-1)
|
||||
}
|
||||
|
||||
// checkPermutationPossibility returns 1st occurrence Index where
|
||||
// value is in decreasing order(from right to left)
|
||||
// returns -1 if not found(it's already in its last permutation)
|
||||
func checkPermutationPossibility(nums []int) (idx int) {
|
||||
// search right to left for 1st number(from right) that is not in increasing order
|
||||
var rp = len(nums) - 1
|
||||
for rp > 0 {
|
||||
if nums[rp-1] < nums[rp] {
|
||||
idx = rp - 1
|
||||
return idx
|
||||
}
|
||||
rp--
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
@ -99,6 +99,7 @@ You have to rotate the image **[in-place](https://en.wikipedia.org/wiki/In-plac
|
||||
```go
|
||||
package leetcode
|
||||
|
||||
// 解法一
|
||||
func rotate(matrix [][]int) {
|
||||
length := len(matrix)
|
||||
// rotate by diagonal 对角线变换
|
||||
@ -114,6 +115,50 @@ func rotate(matrix [][]int) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 解法二
|
||||
func rotate1(matrix [][]int) {
|
||||
n := len(matrix)
|
||||
if n == 1 {
|
||||
return
|
||||
}
|
||||
/* rotate clock-wise = 1. transpose matrix => 2. reverse(matrix[i])
|
||||
|
||||
1 2 3 4 1 5 9 13 13 9 5 1
|
||||
5 6 7 8 => 2 6 10 14 => 14 10 6 2
|
||||
9 10 11 12 3 7 11 15 15 11 7 3
|
||||
13 14 15 16 4 8 12 16 16 12 8 4
|
||||
|
||||
*/
|
||||
|
||||
for i := 0; i < n; i++ {
|
||||
// transpose, i=rows, j=columns
|
||||
// j = i+1, coz diagonal elements didn't change in a square matrix
|
||||
for j := i + 1; j < n; j++ {
|
||||
swap(matrix, i, j)
|
||||
}
|
||||
// reverse each row of the image
|
||||
matrix[i] = reverse(matrix[i])
|
||||
}
|
||||
}
|
||||
|
||||
// swap changes original slice's i,j position
|
||||
func swap(nums [][]int, i, j int) {
|
||||
nums[i][j], nums[j][i] = nums[j][i], nums[i][j]
|
||||
}
|
||||
|
||||
// reverses a row of image, matrix[i]
|
||||
func reverse(nums []int) []int {
|
||||
var lp, rp = 0, len(nums) - 1
|
||||
|
||||
for lp < rp {
|
||||
nums[lp], nums[rp] = nums[rp], nums[lp]
|
||||
lp++
|
||||
rp--
|
||||
}
|
||||
return nums
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
@ -105,7 +105,7 @@ weight: 1
|
||||
|0315|Count of Smaller Numbers After Self|[Go]({{< relref "/ChapterFour/0300~0399/0315.Count-of-Smaller-Numbers-After-Self.md" >}})|Hard||||42.0%|
|
||||
|0318|Maximum Product of Word Lengths|[Go]({{< relref "/ChapterFour/0300~0399/0318.Maximum-Product-of-Word-Lengths.md" >}})|Medium||||56.0%|
|
||||
|0322|Coin Change|[Go]({{< relref "/ChapterFour/0300~0399/0322.Coin-Change.md" >}})|Medium||||39.0%|
|
||||
|0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0300~0399/0324.Wiggle-Sort-II.md" >}})|Medium||||31.6%|
|
||||
|0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0300~0399/0324.Wiggle-Sort-II.md" >}})|Medium||||31.5%|
|
||||
|0327|Count of Range Sum|[Go]({{< relref "/ChapterFour/0300~0399/0327.Count-of-Range-Sum.md" >}})|Hard||||36.0%|
|
||||
|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium||||63.7%|
|
||||
|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy||||67.5%|
|
||||
@ -199,7 +199,7 @@ weight: 1
|
||||
|0733|Flood Fill|[Go]({{< relref "/ChapterFour/0700~0799/0733.Flood-Fill.md" >}})|Easy||||56.9%|
|
||||
|0735|Asteroid Collision|[Go]({{< relref "/ChapterFour/0700~0799/0735.Asteroid-Collision.md" >}})|Medium||||44.1%|
|
||||
|0739|Daily Temperatures|[Go]({{< relref "/ChapterFour/0700~0799/0739.Daily-Temperatures.md" >}})|Medium||||66.1%|
|
||||
|0744|Find Smallest Letter Greater Than Target|[Go]({{< relref "/ChapterFour/0700~0799/0744.Find-Smallest-Letter-Greater-Than-Target.md" >}})|Easy||||45.9%|
|
||||
|0744|Find Smallest Letter Greater Than Target|[Go]({{< relref "/ChapterFour/0700~0799/0744.Find-Smallest-Letter-Greater-Than-Target.md" >}})|Easy||||45.8%|
|
||||
|0746|Min Cost Climbing Stairs|[Go]({{< relref "/ChapterFour/0700~0799/0746.Min-Cost-Climbing-Stairs.md" >}})|Easy| O(n)| O(1)||55.9%|
|
||||
|0752|Open the Lock|[Go]({{< relref "/ChapterFour/0700~0799/0752.Open-the-Lock.md" >}})|Medium||||55.0%|
|
||||
|0766|Toeplitz Matrix|[Go]({{< relref "/ChapterFour/0700~0799/0766.Toeplitz-Matrix.md" >}})|Easy| O(n)| O(1)||66.8%|
|
||||
|
@ -176,7 +176,7 @@ func peakIndexInMountainArray(A []int) int {
|
||||
|0710|Random Pick with Blacklist|[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})|Hard| O(n)| O(n) ||33.1%|
|
||||
|0718|Maximum Length of Repeated Subarray|[Go]({{< relref "/ChapterFour/0700~0799/0718.Maximum-Length-of-Repeated-Subarray.md" >}})|Medium||||51.2%|
|
||||
|0719|Find K-th Smallest Pair Distance|[Go]({{< relref "/ChapterFour/0700~0799/0719.Find-K-th-Smallest-Pair-Distance.md" >}})|Hard||||33.8%|
|
||||
|0744|Find Smallest Letter Greater Than Target|[Go]({{< relref "/ChapterFour/0700~0799/0744.Find-Smallest-Letter-Greater-Than-Target.md" >}})|Easy||||45.9%|
|
||||
|0744|Find Smallest Letter Greater Than Target|[Go]({{< relref "/ChapterFour/0700~0799/0744.Find-Smallest-Letter-Greater-Than-Target.md" >}})|Easy||||45.8%|
|
||||
|0778|Swim in Rising Water|[Go]({{< relref "/ChapterFour/0700~0799/0778.Swim-in-Rising-Water.md" >}})|Hard||||58.1%|
|
||||
|0786|K-th Smallest Prime Fraction|[Go]({{< relref "/ChapterFour/0700~0799/0786.K-th-Smallest-Prime-Fraction.md" >}})|Hard||||47.0%|
|
||||
|0793|Preimage Size of Factorial Zeroes Function|[Go]({{< relref "/ChapterFour/0700~0799/0793.Preimage-Size-of-Factorial-Zeroes-Function.md" >}})|Hard||||41.0%|
|
||||
|
@ -78,7 +78,7 @@ weight: 10
|
||||
|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||51.0%|
|
||||
|1203|Sort Items by Groups Respecting Dependencies|[Go]({{< relref "/ChapterFour/1200~1299/1203.Sort-Items-by-Groups-Respecting-Dependencies.md" >}})|Hard||||49.0%|
|
||||
|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||62.7%|
|
||||
|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||85.6%|
|
||||
|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||85.5%|
|
||||
|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}})|Medium||||61.6%|
|
||||
|1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||56.3%|
|
||||
|1631|Path With Minimum Effort|[Go]({{< relref "/ChapterFour/1600~1699/1631.Path-With-Minimum-Effort.md" >}})|Medium||||51.0%|
|
||||
|
@ -42,7 +42,7 @@ weight: 9
|
||||
|0337|House Robber III|[Go]({{< relref "/ChapterFour/0300~0399/0337.House-Robber-III.md" >}})|Medium||||52.5%|
|
||||
|0341|Flatten Nested List Iterator|[Go]({{< relref "/ChapterFour/0300~0399/0341.Flatten-Nested-List-Iterator.md" >}})|Medium||||57.5%|
|
||||
|0385|Mini Parser|[Go]({{< relref "/ChapterFour/0300~0399/0385.Mini-Parser.md" >}})|Medium||||35.3%|
|
||||
|0386|Lexicographical Numbers|[Go]({{< relref "/ChapterFour/0300~0399/0386.Lexicographical-Numbers.md" >}})|Medium||||56.9%|
|
||||
|0386|Lexicographical Numbers|[Go]({{< relref "/ChapterFour/0300~0399/0386.Lexicographical-Numbers.md" >}})|Medium||||57.0%|
|
||||
|0399|Evaluate Division|[Go]({{< relref "/ChapterFour/0300~0399/0399.Evaluate-Division.md" >}})|Medium||||55.9%|
|
||||
|0404|Sum of Left Leaves|[Go]({{< relref "/ChapterFour/0400~0499/0404.Sum-of-Left-Leaves.md" >}})|Easy||||54.2%|
|
||||
|0417|Pacific Atlantic Water Flow|[Go]({{< relref "/ChapterFour/0400~0499/0417.Pacific-Atlantic-Water-Flow.md" >}})|Medium||||46.6%|
|
||||
@ -105,7 +105,7 @@ weight: 9
|
||||
|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||51.0%|
|
||||
|1203|Sort Items by Groups Respecting Dependencies|[Go]({{< relref "/ChapterFour/1200~1299/1203.Sort-Items-by-Groups-Respecting-Dependencies.md" >}})|Hard||||49.0%|
|
||||
|1254|Number of Closed Islands|[Go]({{< relref "/ChapterFour/1200~1299/1254.Number-of-Closed-Islands.md" >}})|Medium||||62.7%|
|
||||
|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||85.6%|
|
||||
|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||85.5%|
|
||||
|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1300~1399/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||78.5%|
|
||||
|1306|Jump Game III|[Go]({{< relref "/ChapterFour/1300~1399/1306.Jump-Game-III.md" >}})|Medium||||61.6%|
|
||||
|1319|Number of Operations to Make Network Connected|[Go]({{< relref "/ChapterFour/1300~1399/1319.Number-of-Operations-to-Make-Network-Connected.md" >}})|Medium||||56.3%|
|
||||
|
@ -129,7 +129,7 @@ weight: 13
|
||||
|1128|Number of Equivalent Domino Pairs|[Go]({{< relref "/ChapterFour/1100~1199/1128.Number-of-Equivalent-Domino-Pairs.md" >}})|Easy||||45.8%|
|
||||
|1160|Find Words That Can Be Formed by Characters|[Go]({{< relref "/ChapterFour/1100~1199/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}})|Easy||||67.8%|
|
||||
|1170|Compare Strings by Frequency of the Smallest Character|[Go]({{< relref "/ChapterFour/1100~1199/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}})|Medium||||60.8%|
|
||||
|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1100~1199/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||42.0%|
|
||||
|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1100~1199/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||42.1%|
|
||||
|1178|Number of Valid Words for Each Puzzle|[Go]({{< relref "/ChapterFour/1100~1199/1178.Number-of-Valid-Words-for-Each-Puzzle.md" >}})|Hard||||41.1%|
|
||||
|1189|Maximum Number of Balloons|[Go]({{< relref "/ChapterFour/1100~1199/1189.Maximum-Number-of-Balloons.md" >}})|Easy||||62.5%|
|
||||
|1202|Smallest String With Swaps|[Go]({{< relref "/ChapterFour/1200~1299/1202.Smallest-String-With-Swaps.md" >}})|Medium||||51.0%|
|
||||
|
@ -59,7 +59,7 @@ weight: 4
|
||||
|0817|Linked List Components|[Go]({{< relref "/ChapterFour/0800~0899/0817.Linked-List-Components.md" >}})|Medium| O(n)| O(1)||57.9%|
|
||||
|0876|Middle of the Linked List|[Go]({{< relref "/ChapterFour/0800~0899/0876.Middle-of-the-Linked-List.md" >}})|Easy| O(n)| O(1)|❤️|70.7%|
|
||||
|1019|Next Greater Node In Linked List|[Go]({{< relref "/ChapterFour/1000~1099/1019.Next-Greater-Node-In-Linked-List.md" >}})|Medium| O(n)| O(1)||59.3%|
|
||||
|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1100~1199/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||42.0%|
|
||||
|1171|Remove Zero Sum Consecutive Nodes from Linked List|[Go]({{< relref "/ChapterFour/1100~1199/1171.Remove-Zero-Sum-Consecutive-Nodes-from-Linked-List.md" >}})|Medium||||42.1%|
|
||||
|1290|Convert Binary Number in a Linked List to Integer|[Go]({{< relref "/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})|Easy||||81.8%|
|
||||
|1669|Merge In Between Linked Lists|[Go]({{< relref "/ChapterFour/1600~1699/1669.Merge-In-Between-Linked-Lists.md" >}})|Medium||||74.9%|
|
||||
|1670|Design Front Middle Back Queue|[Go]({{< relref "/ChapterFour/1600~1699/1670.Design-Front-Middle-Back-Queue.md" >}})|Medium||||54.9%|
|
||||
|
@ -124,7 +124,7 @@ weight: 12
|
||||
|1442|Count Triplets That Can Form Two Arrays of Equal XOR|[Go]({{< relref "/ChapterFour/1400~1499/1442.Count-Triplets-That-Can-Form-Two-Arrays-of-Equal-XOR.md" >}})|Medium||||73.7%|
|
||||
|1486|XOR Operation in an Array|[Go]({{< relref "/ChapterFour/1400~1499/1486.XOR-Operation-in-an-Array.md" >}})|Easy||||84.0%|
|
||||
|1512|Number of Good Pairs|[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})|Easy||||87.7%|
|
||||
|1551|Minimum Operations to Make Array Equal|[Go]({{< relref "/ChapterFour/1500~1599/1551.Minimum-Operations-to-Make-Array-Equal.md" >}})|Medium||||80.7%|
|
||||
|1551|Minimum Operations to Make Array Equal|[Go]({{< relref "/ChapterFour/1500~1599/1551.Minimum-Operations-to-Make-Array-Equal.md" >}})|Medium||||80.6%|
|
||||
|1573|Number of Ways to Split a String|[Go]({{< relref "/ChapterFour/1500~1599/1573.Number-of-Ways-to-Split-a-String.md" >}})|Medium||||31.4%|
|
||||
|1648|Sell Diminishing-Valued Colored Balls|[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})|Medium||||31.4%|
|
||||
|1680|Concatenation of Consecutive Binary Numbers|[Go]({{< relref "/ChapterFour/1600~1699/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})|Medium||||52.4%|
|
||||
|
@ -37,7 +37,7 @@ weight: 14
|
||||
|0242|Valid Anagram|[Go]({{< relref "/ChapterFour/0200~0299/0242.Valid-Anagram.md" >}})|Easy| O(n)| O(n) ||60.2%|
|
||||
|0268|Missing Number|[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})|Easy||||57.7%|
|
||||
|0274|H-Index|[Go]({{< relref "/ChapterFour/0200~0299/0274.H-Index.md" >}})|Medium| O(n)| O(n) ||37.0%|
|
||||
|0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0300~0399/0324.Wiggle-Sort-II.md" >}})|Medium| O(n)| O(n)|❤️|31.6%|
|
||||
|0324|Wiggle Sort II|[Go]({{< relref "/ChapterFour/0300~0399/0324.Wiggle-Sort-II.md" >}})|Medium| O(n)| O(n)|❤️|31.5%|
|
||||
|0347|Top K Frequent Elements|[Go]({{< relref "/ChapterFour/0300~0399/0347.Top-K-Frequent-Elements.md" >}})|Medium||||63.7%|
|
||||
|0349|Intersection of Two Arrays|[Go]({{< relref "/ChapterFour/0300~0399/0349.Intersection-of-Two-Arrays.md" >}})|Easy| O(n)| O(n) ||67.5%|
|
||||
|0350|Intersection of Two Arrays II|[Go]({{< relref "/ChapterFour/0300~0399/0350.Intersection-of-Two-Arrays-II.md" >}})|Easy| O(n)| O(n) ||53.8%|
|
||||
|
@ -84,7 +84,7 @@ weight: 6
|
||||
|1110|Delete Nodes And Return Forest|[Go]({{< relref "/ChapterFour/1100~1199/1110.Delete-Nodes-And-Return-Forest.md" >}})|Medium||||68.8%|
|
||||
|1123|Lowest Common Ancestor of Deepest Leaves|[Go]({{< relref "/ChapterFour/1100~1199/1123.Lowest-Common-Ancestor-of-Deepest-Leaves.md" >}})|Medium||||69.1%|
|
||||
|1145|Binary Tree Coloring Game|[Go]({{< relref "/ChapterFour/1100~1199/1145.Binary-Tree-Coloring-Game.md" >}})|Medium||||51.0%|
|
||||
|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||85.6%|
|
||||
|1302|Deepest Leaves Sum|[Go]({{< relref "/ChapterFour/1300~1399/1302.Deepest-Leaves-Sum.md" >}})|Medium||||85.5%|
|
||||
|1305|All Elements in Two Binary Search Trees|[Go]({{< relref "/ChapterFour/1300~1399/1305.All-Elements-in-Two-Binary-Search-Trees.md" >}})|Medium||||78.5%|
|
||||
|1600|Throne Inheritance|[Go]({{< relref "/ChapterFour/1600~1699/1600.Throne-Inheritance.md" >}})|Medium||||62.2%|
|
||||
|------------|-------------------------------------------------------|-------| ----------------| ---------------|-------------|-------------|-------------|
|
||||
|
Reference in New Issue
Block a user