Files
2021-01-21 18:13:45 +08:00

17 KiB

title type
Array docs

Array

No. Title Solution Difficulty TimeComplexity SpaceComplexity Favorite Acceptance
0001 Two Sum [Go]({{< relref "/ChapterFour/0001.Two-Sum.md" >}}) Easy O(n) O(n) 46.2%
0004 Median of Two Sorted Arrays [Go]({{< relref "/ChapterFour/0004.Median-of-Two-Sorted-Arrays.md" >}}) Hard 30.8%
0011 Container With Most Water [Go]({{< relref "/ChapterFour/0011.Container-With-Most-Water.md" >}}) Medium O(n) O(1) 52.2%
0015 3Sum [Go]({{< relref "/ChapterFour/0015.3Sum.md" >}}) Medium O(n^2) O(n) ❤️ 27.8%
0016 3Sum Closest [Go]({{< relref "/ChapterFour/0016.3Sum-Closest.md" >}}) Medium O(n^2) O(1) ❤️ 46.3%
0018 4Sum [Go]({{< relref "/ChapterFour/0018.4Sum.md" >}}) Medium O(n^3) O(n^2) ❤️ 34.7%
0026 Remove Duplicates from Sorted Array [Go]({{< relref "/ChapterFour/0026.Remove-Duplicates-from-Sorted-Array.md" >}}) Easy O(n) O(1) 46.4%
0027 Remove Element [Go]({{< relref "/ChapterFour/0027.Remove-Element.md" >}}) Easy O(n) O(1) 49.1%
0033 Search in Rotated Sorted Array [Go]({{< relref "/ChapterFour/0033.Search-in-Rotated-Sorted-Array.md" >}}) Medium 35.7%
0034 Find First and Last Position of Element in Sorted Array [Go]({{< relref "/ChapterFour/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array.md" >}}) Medium 37.1%
0035 Search Insert Position [Go]({{< relref "/ChapterFour/0035.Search-Insert-Position.md" >}}) Easy 42.8%
0039 Combination Sum [Go]({{< relref "/ChapterFour/0039.Combination-Sum.md" >}}) Medium O(n log n) O(n) 58.8%
0040 Combination Sum II [Go]({{< relref "/ChapterFour/0040.Combination-Sum-II.md" >}}) Medium O(n log n) O(n) 49.9%
0041 First Missing Positive [Go]({{< relref "/ChapterFour/0041.First-Missing-Positive.md" >}}) Hard O(n) O(n) 33.5%
0042 Trapping Rain Water [Go]({{< relref "/ChapterFour/0042.Trapping-Rain-Water.md" >}}) Hard O(n) O(1) ❤️ 50.8%
0048 Rotate Image [Go]({{< relref "/ChapterFour/0048.Rotate-Image.md" >}}) Medium O(n) O(1) 59.4%
0053 Maximum Subarray [Go]({{< relref "/ChapterFour/0053.Maximum-Subarray.md" >}}) Easy O(n) O(n) 47.6%
0054 Spiral Matrix [Go]({{< relref "/ChapterFour/0054.Spiral-Matrix.md" >}}) Medium O(n) O(n^2) 35.6%
0055 Jump Game [Go]({{< relref "/ChapterFour/0055.Jump-Game.md" >}}) Medium 35.1%
0056 Merge Intervals [Go]({{< relref "/ChapterFour/0056.Merge-Intervals.md" >}}) Medium O(n log n) O(1) 40.7%
0057 Insert Interval [Go]({{< relref "/ChapterFour/0057.Insert-Interval.md" >}}) Medium O(n) O(1) 34.9%
0059 Spiral Matrix II [Go]({{< relref "/ChapterFour/0059.Spiral-Matrix-II.md" >}}) Medium O(n) O(n^2) 57.5%
0062 Unique Paths [Go]({{< relref "/ChapterFour/0062.Unique-Paths.md" >}}) Medium O(n^2) O(n^2) 55.7%
0063 Unique Paths II [Go]({{< relref "/ChapterFour/0063.Unique-Paths-II.md" >}}) Medium O(n^2) O(n^2) 35.1%
0064 Minimum Path Sum [Go]({{< relref "/ChapterFour/0064.Minimum-Path-Sum.md" >}}) Medium O(n^2) O(n^2) 55.9%
0066 Plus One [Go]({{< relref "/ChapterFour/0066.Plus-One.md" >}}) Easy 42.5%
0074 Search a 2D Matrix [Go]({{< relref "/ChapterFour/0074.Search-a-2D-Matrix.md" >}}) Medium 37.4%
0075 Sort Colors [Go]({{< relref "/ChapterFour/0075.Sort-Colors.md" >}}) Medium O(n) O(1) ❤️ 49.0%
0078 Subsets [Go]({{< relref "/ChapterFour/0078.Subsets.md" >}}) Medium O(n^2) O(n) ❤️ 64.6%
0079 Word Search [Go]({{< relref "/ChapterFour/0079.Word-Search.md" >}}) Medium O(n^2) O(n^2) ❤️ 36.6%
0080 Remove Duplicates from Sorted Array II [Go]({{< relref "/ChapterFour/0080.Remove-Duplicates-from-Sorted-Array-II.md" >}}) Medium O(n) O(1 45.9%
0081 Search in Rotated Sorted Array II [Go]({{< relref "/ChapterFour/0081.Search-in-Rotated-Sorted-Array-II.md" >}}) Medium 33.5%
0084 Largest Rectangle in Histogram [Go]({{< relref "/ChapterFour/0084.Largest-Rectangle-in-Histogram.md" >}}) Hard O(n) O(n) ❤️ 36.8%
0088 Merge Sorted Array [Go]({{< relref "/ChapterFour/0088.Merge-Sorted-Array.md" >}}) Easy O(n) O(1) ❤️ 40.6%
0090 Subsets II [Go]({{< relref "/ChapterFour/0090.Subsets-II.md" >}}) Medium O(n^2) O(n) ❤️ 48.5%
0105 Construct Binary Tree from Preorder and Inorder Traversal [Go]({{< relref "/ChapterFour/0105.Construct-Binary-Tree-from-Preorder-and-Inorder-Traversal.md" >}}) Medium 51.3%
0106 Construct Binary Tree from Inorder and Postorder Traversal [Go]({{< relref "/ChapterFour/0106.Construct-Binary-Tree-from-Inorder-and-Postorder-Traversal.md" >}}) Medium 49.2%
0118 Pascal's Triangle [Go]({{< relref "/ChapterFour/0118.Pascals-Triangle.md" >}}) Easy 54.4%
0120 Triangle [Go]({{< relref "/ChapterFour/0120.Triangle.md" >}}) Medium O(n^2) O(n) 45.5%
0121 Best Time to Buy and Sell Stock [Go]({{< relref "/ChapterFour/0121.Best-Time-to-Buy-and-Sell-Stock.md" >}}) Easy O(n) O(1) 51.3%
0122 Best Time to Buy and Sell Stock II [Go]({{< relref "/ChapterFour/0122.Best-Time-to-Buy-and-Sell-Stock-II.md" >}}) Easy O(n) O(1) 58.3%
0126 Word Ladder II [Go]({{< relref "/ChapterFour/0126.Word-Ladder-II.md" >}}) Hard O(n) O(n^2) ❤️ 23.4%
0128 Longest Consecutive Sequence [Go]({{< relref "/ChapterFour/0128.Longest-Consecutive-Sequence.md" >}}) Hard 46.1%
0152 Maximum Product Subarray [Go]({{< relref "/ChapterFour/0152.Maximum-Product-Subarray.md" >}}) Medium O(n) O(1) 32.6%
0153 Find Minimum in Rotated Sorted Array [Go]({{< relref "/ChapterFour/0153.Find-Minimum-in-Rotated-Sorted-Array.md" >}}) Medium 45.9%
0154 Find Minimum in Rotated Sorted Array II [Go]({{< relref "/ChapterFour/0154.Find-Minimum-in-Rotated-Sorted-Array-II.md" >}}) Hard 41.9%
0162 Find Peak Element [Go]({{< relref "/ChapterFour/0162.Find-Peak-Element.md" >}}) Medium 43.8%
0167 Two Sum II - Input array is sorted [Go]({{< relref "/ChapterFour/0167.Two-Sum-II---Input-array-is-sorted.md" >}}) Easy O(n) O(1) 55.4%
0169 Majority Element [Go]({{< relref "/ChapterFour/0169.Majority-Element.md" >}}) Easy 59.9%
0189 Rotate Array [Go]({{< relref "/ChapterFour/0189.Rotate-Array.md" >}}) Medium 36.4%
0209 Minimum Size Subarray Sum [Go]({{< relref "/ChapterFour/0209.Minimum-Size-Subarray-Sum.md" >}}) Medium O(n) O(1) 39.2%
0216 Combination Sum III [Go]({{< relref "/ChapterFour/0216.Combination-Sum-III.md" >}}) Medium O(n) O(1) ❤️ 60.0%
0217 Contains Duplicate [Go]({{< relref "/ChapterFour/0217.Contains-Duplicate.md" >}}) Easy O(n) O(n) 56.5%
0219 Contains Duplicate II [Go]({{< relref "/ChapterFour/0219.Contains-Duplicate-II.md" >}}) Easy O(n) O(n) 38.5%
0228 Summary Ranges [Go]({{< relref "/ChapterFour/0228.Summary-Ranges.md" >}}) Easy 42.1%
0229 Majority Element II [Go]({{< relref "/ChapterFour/0229.Majority-Element-II.md" >}}) Medium 38.5%
0268 Missing Number [Go]({{< relref "/ChapterFour/0268.Missing-Number.md" >}}) Easy 53.5%
0283 Move Zeroes [Go]({{< relref "/ChapterFour/0283.Move-Zeroes.md" >}}) Easy O(n) O(1) 58.5%
0287 Find the Duplicate Number [Go]({{< relref "/ChapterFour/0287.Find-the-Duplicate-Number.md" >}}) Medium O(n) O(1) ❤️ 57.2%
0414 Third Maximum Number [Go]({{< relref "/ChapterFour/0414.Third-Maximum-Number.md" >}}) Easy 30.6%
0448 Find All Numbers Disappeared in an Array [Go]({{< relref "/ChapterFour/0448.Find-All-Numbers-Disappeared-in-an-Array.md" >}}) Easy 56.1%
0457 Circular Array Loop [Go]({{< relref "/ChapterFour/0457.Circular-Array-Loop.md" >}}) Medium 30.0%
0485 Max Consecutive Ones [Go]({{< relref "/ChapterFour/0485.Max-Consecutive-Ones.md" >}}) Easy 53.2%
0509 Fibonacci Number [Go]({{< relref "/ChapterFour/0509.Fibonacci-Number.md" >}}) Easy 67.3%
0532 K-diff Pairs in an Array [Go]({{< relref "/ChapterFour/0532.K-diff-Pairs-in-an-Array.md" >}}) Medium O(n) O(n) 34.9%
0561 Array Partition I [Go]({{< relref "/ChapterFour/0561.Array-Partition-I.md" >}}) Easy 72.9%
0566 Reshape the Matrix [Go]({{< relref "/ChapterFour/0566.Reshape-the-Matrix.md" >}}) Easy O(n^2) O(n^2) 61.0%
0605 Can Place Flowers [Go]({{< relref "/ChapterFour/0605.Can-Place-Flowers.md" >}}) Easy 31.9%
0628 Maximum Product of Three Numbers [Go]({{< relref "/ChapterFour/0628.Maximum-Product-of-Three-Numbers.md" >}}) Easy O(n) O(1) 47.0%
0661 Image Smoother [Go]({{< relref "/ChapterFour/0661.Image-Smoother.md" >}}) Easy 52.2%
0695 Max Area of Island [Go]({{< relref "/ChapterFour/0695.Max-Area-of-Island.md" >}}) Medium 64.4%
0697 Degree of an Array [Go]({{< relref "/ChapterFour/0697.Degree-of-an-Array.md" >}}) Easy 54.4%
0713 Subarray Product Less Than K [Go]({{< relref "/ChapterFour/0713.Subarray-Product-Less-Than-K.md" >}}) Medium O(n) O(1) 40.4%
0714 Best Time to Buy and Sell Stock with Transaction Fee [Go]({{< relref "/ChapterFour/0714.Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee.md" >}}) Medium O(n) O(1) 55.9%
0717 1-bit and 2-bit Characters [Go]({{< relref "/ChapterFour/0717.1-bit-and-2-bit-Characters.md" >}}) Easy 47.5%
0718 Maximum Length of Repeated Subarray [Go]({{< relref "/ChapterFour/0718.Maximum-Length-of-Repeated-Subarray.md" >}}) Medium 50.2%
0719 Find K-th Smallest Pair Distance [Go]({{< relref "/ChapterFour/0719.Find-K-th-Smallest-Pair-Distance.md" >}}) Hard 32.5%
0724 Find Pivot Index [Go]({{< relref "/ChapterFour/0724.Find-Pivot-Index.md" >}}) Easy 45.0%
0729 My Calendar I [Go]({{< relref "/ChapterFour/0729.My-Calendar-I.md" >}}) Medium 53.1%
0746 Min Cost Climbing Stairs [Go]({{< relref "/ChapterFour/0746.Min-Cost-Climbing-Stairs.md" >}}) Easy O(n) O(1) 50.9%
0766 Toeplitz Matrix [Go]({{< relref "/ChapterFour/0766.Toeplitz-Matrix.md" >}}) Easy O(n) O(1) 65.8%
0830 Positions of Large Groups [Go]({{< relref "/ChapterFour/0830.Positions-of-Large-Groups.md" >}}) Easy 50.3%
0832 Flipping an Image [Go]({{< relref "/ChapterFour/0832.Flipping-an-Image.md" >}}) Easy 78.0%
0867 Transpose Matrix [Go]({{< relref "/ChapterFour/0867.Transpose-Matrix.md" >}}) Easy O(n) O(1) 62.2%
0888 Fair Candy Swap [Go]({{< relref "/ChapterFour/0888.Fair-Candy-Swap.md" >}}) Easy 58.9%
0891 Sum of Subsequence Widths [Go]({{< relref "/ChapterFour/0891.Sum-of-Subsequence-Widths.md" >}}) Hard O(n log n) O(1) 32.8%
0896 Monotonic Array [Go]({{< relref "/ChapterFour/0896.Monotonic-Array.md" >}}) Easy 58.0%
0907 Sum of Subarray Minimums [Go]({{< relref "/ChapterFour/0907.Sum-of-Subarray-Minimums.md" >}}) Medium O(n) O(n) ❤️ 33.2%
0914 X of a Kind in a Deck of Cards [Go]({{< relref "/ChapterFour/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}}) Easy 34.4%
0918 Maximum Sum Circular Subarray [Go]({{< relref "/ChapterFour/0918.Maximum-Sum-Circular-Subarray.md" >}}) Medium 34.1%
0922 Sort Array By Parity II [Go]({{< relref "/ChapterFour/0922.Sort-Array-By-Parity-II.md" >}}) Easy O(n) O(1) 70.3%
0969 Pancake Sorting [Go]({{< relref "/ChapterFour/0969.Pancake-Sorting.md" >}}) Medium O(n) O(1) ❤️ 68.6%
0977 Squares of a Sorted Array [Go]({{< relref "/ChapterFour/0977.Squares-of-a-Sorted-Array.md" >}}) Easy O(n) O(1) 72.3%
0978 Longest Turbulent Subarray [Go]({{< relref "/ChapterFour/0978.Longest-Turbulent-Subarray.md" >}}) Medium 46.5%
0985 Sum of Even Numbers After Queries [Go]({{< relref "/ChapterFour/0985.Sum-of-Even-Numbers-After-Queries.md" >}}) Easy 60.7%
0999 Available Captures for Rook [Go]({{< relref "/ChapterFour/0999.Available-Captures-for-Rook.md" >}}) Easy 66.9%
1002 Find Common Characters [Go]({{< relref "/ChapterFour/1002.Find-Common-Characters.md" >}}) Easy 68.1%
1011 Capacity To Ship Packages Within D Days [Go]({{< relref "/ChapterFour/1011.Capacity-To-Ship-Packages-Within-D-Days.md" >}}) Medium 59.5%
1018 Binary Prefix Divisible By 5 [Go]({{< relref "/ChapterFour/1018.Binary-Prefix-Divisible-By-5.md" >}}) Easy 47.8%
1040 Moving Stones Until Consecutive II [Go]({{< relref "/ChapterFour/1040.Moving-Stones-Until-Consecutive-II.md" >}}) Medium 53.9%
1051 Height Checker [Go]({{< relref "/ChapterFour/1051.Height-Checker.md" >}}) Easy 72.0%
1052 Grumpy Bookstore Owner [Go]({{< relref "/ChapterFour/1052.Grumpy-Bookstore-Owner.md" >}}) Medium 55.7%
1074 Number of Submatrices That Sum to Target [Go]({{< relref "/ChapterFour/1074.Number-of-Submatrices-That-Sum-to-Target.md" >}}) Hard 61.5%
1089 Duplicate Zeros [Go]({{< relref "/ChapterFour/1089.Duplicate-Zeros.md" >}}) Easy 52.1%
1122 Relative Sort Array [Go]({{< relref "/ChapterFour/1122.Relative-Sort-Array.md" >}}) Easy 67.8%
1128 Number of Equivalent Domino Pairs [Go]({{< relref "/ChapterFour/1128.Number-of-Equivalent-Domino-Pairs.md" >}}) Easy 46.6%
1157 Online Majority Element In Subarray [Go]({{< relref "/ChapterFour/1157.Online-Majority-Element-In-Subarray.md" >}}) Hard 39.6%
1160 Find Words That Can Be Formed by Characters [Go]({{< relref "/ChapterFour/1160.Find-Words-That-Can-Be-Formed-by-Characters.md" >}}) Easy 67.5%
1170 Compare Strings by Frequency of the Smallest Character [Go]({{< relref "/ChapterFour/1170.Compare-Strings-by-Frequency-of-the-Smallest-Character.md" >}}) Medium 59.5%
1184 Distance Between Bus Stops [Go]({{< relref "/ChapterFour/1184.Distance-Between-Bus-Stops.md" >}}) Easy 54.2%
1185 Day of the Week [Go]({{< relref "/ChapterFour/1185.Day-of-the-Week.md" >}}) Easy 61.9%
1200 Minimum Absolute Difference [Go]({{< relref "/ChapterFour/1200.Minimum-Absolute-Difference.md" >}}) Easy 66.8%
1202 Smallest String With Swaps [Go]({{< relref "/ChapterFour/1202.Smallest-String-With-Swaps.md" >}}) Medium 48.5%
1208 Get Equal Substrings Within Budget [Go]({{< relref "/ChapterFour/1208.Get-Equal-Substrings-Within-Budget.md" >}}) Medium 43.7%
1217 Minimum Cost to Move Chips to The Same Position [Go]({{< relref "/ChapterFour/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position.md" >}}) Easy 71.2%
1232 Check If It Is a Straight Line [Go]({{< relref "/ChapterFour/1232.Check-If-It-Is-a-Straight-Line.md" >}}) Easy 43.8%
1252 Cells with Odd Values in a Matrix [Go]({{< relref "/ChapterFour/1252.Cells-with-Odd-Values-in-a-Matrix.md" >}}) Easy 78.7%
1260 Shift 2D Grid [Go]({{< relref "/ChapterFour/1260.Shift-2D-Grid.md" >}}) Easy 61.8%
1266 Minimum Time Visiting All Points [Go]({{< relref "/ChapterFour/1266.Minimum-Time-Visiting-All-Points.md" >}}) Easy 79.4%
1275 Find Winner on a Tic Tac Toe Game [Go]({{< relref "/ChapterFour/1275.Find-Winner-on-a-Tic-Tac-Toe-Game.md" >}}) Easy 53.0%
1287 Element Appearing More Than 25% In Sorted Array [Go]({{< relref "/ChapterFour/1287.Element-Appearing-More-Than-25-In-Sorted-Array.md" >}}) Easy 60.2%
1295 Find Numbers with Even Number of Digits [Go]({{< relref "/ChapterFour/1295.Find-Numbers-with-Even-Number-of-Digits.md" >}}) Easy 79.3%
1299 Replace Elements with Greatest Element on Right Side [Go]({{< relref "/ChapterFour/1299.Replace-Elements-with-Greatest-Element-on-Right-Side.md" >}}) Easy 74.3%
1300 Sum of Mutated Array Closest to Target [Go]({{< relref "/ChapterFour/1300.Sum-of-Mutated-Array-Closest-to-Target.md" >}}) Medium 43.3%
1304 Find N Unique Integers Sum up to Zero [Go]({{< relref "/ChapterFour/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}}) Easy 76.7%
1313 Decompress Run-Length Encoded List [Go]({{< relref "/ChapterFour/1313.Decompress-Run-Length-Encoded-List.md" >}}) Easy 85.4%
1380 Lucky Numbers in a Matrix [Go]({{< relref "/ChapterFour/1380.Lucky-Numbers-in-a-Matrix.md" >}}) Easy 70.8%
1385 Find the Distance Value Between Two Arrays [Go]({{< relref "/ChapterFour/1385.Find-the-Distance-Value-Between-Two-Arrays.md" >}}) Easy 66.4%
1389 Create Target Array in the Given Order [Go]({{< relref "/ChapterFour/1389.Create-Target-Array-in-the-Given-Order.md" >}}) Easy 84.8%
1464 Maximum Product of Two Elements in an Array [Go]({{< relref "/ChapterFour/1464.Maximum-Product-of-Two-Elements-in-an-Array.md" >}}) Easy 77.0%
1470 Shuffle the Array [Go]({{< relref "/ChapterFour/1470.Shuffle-the-Array.md" >}}) Easy 88.5%
1480 Running Sum of 1d Array [Go]({{< relref "/ChapterFour/1480.Running-Sum-of-1d-Array.md" >}}) Easy 89.5%
1512 Number of Good Pairs [Go]({{< relref "/ChapterFour/1512.Number-of-Good-Pairs.md" >}}) Easy 87.9%
1539 Kth Missing Positive Number [Go]({{< relref "/ChapterFour/1539.Kth-Missing-Positive-Number.md" >}}) Easy 55.2%
1640 Check Array Formation Through Concatenation [Go]({{< relref "/ChapterFour/1640.Check-Array-Formation-Through-Concatenation.md" >}}) Easy 61.5%
1646 Get Maximum in Generated Array [Go]({{< relref "/ChapterFour/1646.Get-Maximum-in-Generated-Array.md" >}}) Easy 53.6%
1652 Defuse the Bomb [Go]({{< relref "/ChapterFour/1652.Defuse-the-Bomb.md" >}}) Easy 64.1%
1656 Design an Ordered Stream [Go]({{< relref "/ChapterFour/1656.Design-an-Ordered-Stream.md" >}}) Easy 82.3%
1672 Richest Customer Wealth [Go]({{< relref "/ChapterFour/1672.Richest-Customer-Wealth.md" >}}) Easy 88.4%
------------ ------------------------------------------------------- ------- ---------------- --------------- ------------- ------------- -------------