Back to Leetcode Go

2.12 Math

website/content/ChapterTwo/Math.md

1.7.118.0 KB
Original Source

Math

No.TitleSolutionDifficultyTimeComplexitySpaceComplexityFavoriteAcceptance
0002Add Two Numbers[Go]({{< relref "/ChapterFour/0001~0099/0002.Add-Two-Numbers.md" >}})MediumO(n)O(1)40.4%
0007Reverse Integer[Go]({{< relref "/ChapterFour/0001~0099/0007.Reverse-Integer.md" >}})Medium27.5%
0009Palindrome Number[Go]({{< relref "/ChapterFour/0001~0099/0009.Palindrome-Number.md" >}})Easy53.5%
0012Integer to Roman[Go]({{< relref "/ChapterFour/0001~0099/0012.Integer-to-Roman.md" >}})Medium62.0%
0013Roman to Integer[Go]({{< relref "/ChapterFour/0001~0099/0013.Roman-to-Integer.md" >}})Easy58.6%
0029Divide Two Integers[Go]({{< relref "/ChapterFour/0001~0099/0029.Divide-Two-Integers.md" >}})Medium17.2%
0043Multiply Strings[Go]({{< relref "/ChapterFour/0001~0099/0043.Multiply-Strings.md" >}})Medium39.2%
0048Rotate Image[Go]({{< relref "/ChapterFour/0001~0099/0048.Rotate-Image.md" >}})Medium71.0%
0050Pow(x, n)[Go]({{< relref "/ChapterFour/0001~0099/0050.Powx-n.md" >}})MediumO(log n)O(1)33.0%
0060Permutation Sequence[Go]({{< relref "/ChapterFour/0001~0099/0060.Permutation-Sequence.md" >}})HardO(n log n)O(1)44.4%
0062Unique Paths[Go]({{< relref "/ChapterFour/0001~0099/0062.Unique-Paths.md" >}})Medium62.7%
0066Plus One[Go]({{< relref "/ChapterFour/0001~0099/0066.Plus-One.md" >}})Easy43.7%
0067Add Binary[Go]({{< relref "/ChapterFour/0001~0099/0067.Add-Binary.md" >}})Easy52.4%
0069Sqrt(x)[Go]({{< relref "/ChapterFour/0001~0099/0069.Sqrtx.md" >}})EasyO(log n)O(1)37.4%
0070Climbing Stairs[Go]({{< relref "/ChapterFour/0001~0099/0070.Climbing-Stairs.md" >}})Easy52.2%
0089Gray Code[Go]({{< relref "/ChapterFour/0001~0099/0089.Gray-Code.md" >}})Medium57.2%
0096Unique Binary Search Trees[Go]({{< relref "/ChapterFour/0001~0099/0096.Unique-Binary-Search-Trees.md" >}})Medium59.7%
0150Evaluate Reverse Polish Notation[Go]({{< relref "/ChapterFour/0100~0199/0150.Evaluate-Reverse-Polish-Notation.md" >}})Medium45.8%
0168Excel Sheet Column Title[Go]({{< relref "/ChapterFour/0100~0199/0168.Excel-Sheet-Column-Title.md" >}})Easy35.5%
0171Excel Sheet Column Number[Go]({{< relref "/ChapterFour/0100~0199/0171.Excel-Sheet-Column-Number.md" >}})Easy62.1%
0172Factorial Trailing Zeroes[Go]({{< relref "/ChapterFour/0100~0199/0172.Factorial-Trailing-Zeroes.md" >}})Medium42.2%
0189Rotate Array[Go]({{< relref "/ChapterFour/0100~0199/0189.Rotate-Array.md" >}})Medium39.4%
0202Happy Number[Go]({{< relref "/ChapterFour/0200~0299/0202.Happy-Number.md" >}})EasyO(log n)O(1)54.8%
0204Count Primes[Go]({{< relref "/ChapterFour/0200~0299/0204.Count-Primes.md" >}})Medium33.1%
0223Rectangle Area[Go]({{< relref "/ChapterFour/0200~0299/0223.Rectangle-Area.md" >}})Medium45.1%
0224Basic Calculator[Go]({{< relref "/ChapterFour/0200~0299/0224.Basic-Calculator.md" >}})HardO(n)O(n)42.4%
0227Basic Calculator II[Go]({{< relref "/ChapterFour/0200~0299/0227.Basic-Calculator-II.md" >}})Medium42.4%
0231Power of Two[Go]({{< relref "/ChapterFour/0200~0299/0231.Power-of-Two.md" >}})EasyO(1)O(1)46.0%
0258Add Digits[Go]({{< relref "/ChapterFour/0200~0299/0258.Add-Digits.md" >}})Easy64.0%
0263Ugly Number[Go]({{< relref "/ChapterFour/0200~0299/0263.Ugly-Number.md" >}})EasyO(log n)O(1)42.3%
0264Ugly Number II[Go]({{< relref "/ChapterFour/0200~0299/0264.Ugly-Number-II.md" >}})Medium46.2%
0268Missing Number[Go]({{< relref "/ChapterFour/0200~0299/0268.Missing-Number.md" >}})Easy62.6%
0279Perfect Squares[Go]({{< relref "/ChapterFour/0200~0299/0279.Perfect-Squares.md" >}})Medium52.7%
0319Bulb Switcher[Go]({{< relref "/ChapterFour/0300~0399/0319.Bulb-Switcher.md" >}})Medium48.3%
0326Power of Three[Go]({{< relref "/ChapterFour/0300~0399/0326.Power-of-Three.md" >}})EasyO(1)O(1)45.5%
0342Power of Four[Go]({{< relref "/ChapterFour/0300~0399/0342.Power-of-Four.md" >}})Easy46.2%
0343Integer Break[Go]({{< relref "/ChapterFour/0300~0399/0343.Integer-Break.md" >}})MediumO(n^2)O(n)56.1%
0357Count Numbers with Unique Digits[Go]({{< relref "/ChapterFour/0300~0399/0357.Count-Numbers-with-Unique-Digits.md" >}})MediumO(1)O(1)51.9%
0367Valid Perfect Square[Go]({{< relref "/ChapterFour/0300~0399/0367.Valid-Perfect-Square.md" >}})Easy43.3%
0368Largest Divisible Subset[Go]({{< relref "/ChapterFour/0300~0399/0368.Largest-Divisible-Subset.md" >}})Medium41.6%
0371Sum of Two Integers[Go]({{< relref "/ChapterFour/0300~0399/0371.Sum-of-Two-Integers.md" >}})Medium50.7%
0372Super Pow[Go]({{< relref "/ChapterFour/0300~0399/0372.Super-Pow.md" >}})Medium36.3%
0382Linked List Random Node[Go]({{< relref "/ChapterFour/0300~0399/0382.Linked-List-Random-Node.md" >}})Medium62.8%
0384Shuffle an Array[Go]({{< relref "/ChapterFour/0300~0399/0384.Shuffle-an-Array.md" >}})Medium57.8%
0390Elimination Game[Go]({{< relref "/ChapterFour/0300~0399/0390.Elimination-Game.md" >}})Medium46.1%
0396Rotate Function[Go]({{< relref "/ChapterFour/0300~0399/0396.Rotate-Function.md" >}})Medium41.1%
0400Nth Digit[Go]({{< relref "/ChapterFour/0400~0499/0400.Nth-Digit.md" >}})Medium34.1%
0405Convert a Number to Hexadecimal[Go]({{< relref "/ChapterFour/0400~0499/0405.Convert-a-Number-to-Hexadecimal.md" >}})Easy46.8%
0412Fizz Buzz[Go]({{< relref "/ChapterFour/0400~0499/0412.Fizz-Buzz.md" >}})Easy70.0%
0423Reconstruct Original Digits from English[Go]({{< relref "/ChapterFour/0400~0499/0423.Reconstruct-Original-Digits-from-English.md" >}})Medium51.2%
0441Arranging Coins[Go]({{< relref "/ChapterFour/0400~0499/0441.Arranging-Coins.md" >}})Easy46.2%
0445Add Two Numbers II[Go]({{< relref "/ChapterFour/0400~0499/0445.Add-Two-Numbers-II.md" >}})Medium59.6%
0447Number of Boomerangs[Go]({{< relref "/ChapterFour/0400~0499/0447.Number-of-Boomerangs.md" >}})Medium54.9%
0453Minimum Moves to Equal Array Elements[Go]({{< relref "/ChapterFour/0400~0499/0453.Minimum-Moves-to-Equal-Array-Elements.md" >}})Medium56.0%
0458Poor Pigs[Go]({{< relref "/ChapterFour/0400~0499/0458.Poor-Pigs.md" >}})Hard62.8%
0462Minimum Moves to Equal Array Elements II[Go]({{< relref "/ChapterFour/0400~0499/0462.Minimum-Moves-to-Equal-Array-Elements-II.md" >}})Medium60.0%
0470Implement Rand10() Using Rand7()[Go]({{< relref "/ChapterFour/0400~0499/0470.Implement-Rand10-Using-Rand7.md" >}})Medium46.4%
0477Total Hamming Distance[Go]({{< relref "/ChapterFour/0400~0499/0477.Total-Hamming-Distance.md" >}})Medium52.2%
0478Generate Random Point in a Circle[Go]({{< relref "/ChapterFour/0400~0499/0478.Generate-Random-Point-in-a-Circle.md" >}})Medium39.6%
0483Smallest Good Base[Go]({{< relref "/ChapterFour/0400~0499/0483.Smallest-Good-Base.md" >}})Hard38.8%
0492Construct the Rectangle[Go]({{< relref "/ChapterFour/0400~0499/0492.Construct-the-Rectangle.md" >}})Easy54.8%
0497Random Point in Non-overlapping Rectangles[Go]({{< relref "/ChapterFour/0400~0499/0497.Random-Point-in-Non-overlapping-Rectangles.md" >}})Medium39.4%
0504Base 7[Go]({{< relref "/ChapterFour/0500~0599/0504.Base-7.md" >}})Easy48.5%
0507Perfect Number[Go]({{< relref "/ChapterFour/0500~0599/0507.Perfect-Number.md" >}})Easy37.7%
0509Fibonacci Number[Go]({{< relref "/ChapterFour/0500~0599/0509.Fibonacci-Number.md" >}})Easy69.8%
0519Random Flip Matrix[Go]({{< relref "/ChapterFour/0500~0599/0519.Random-Flip-Matrix.md" >}})Medium40.0%
0523Continuous Subarray Sum[Go]({{< relref "/ChapterFour/0500~0599/0523.Continuous-Subarray-Sum.md" >}})Medium28.5%
0528Random Pick with Weight[Go]({{< relref "/ChapterFour/0500~0599/0528.Random-Pick-with-Weight.md" >}})Medium46.1%
0537Complex Number Multiplication[Go]({{< relref "/ChapterFour/0500~0599/0537.Complex-Number-Multiplication.md" >}})Medium71.4%
0598Range Addition II[Go]({{< relref "/ChapterFour/0500~0599/0598.Range-Addition-II.md" >}})Easy55.3%
0628Maximum Product of Three Numbers[Go]({{< relref "/ChapterFour/0600~0699/0628.Maximum-Product-of-Three-Numbers.md" >}})EasyO(n)O(1)45.9%
0633Sum of Square Numbers[Go]({{< relref "/ChapterFour/0600~0699/0633.Sum-of-Square-Numbers.md" >}})Medium34.4%
0667Beautiful Arrangement II[Go]({{< relref "/ChapterFour/0600~0699/0667.Beautiful-Arrangement-II.md" >}})Medium59.8%
0668Kth Smallest Number in Multiplication Table[Go]({{< relref "/ChapterFour/0600~0699/0668.Kth-Smallest-Number-in-Multiplication-Table.md" >}})Hard51.4%
0710Random Pick with Blacklist[Go]({{< relref "/ChapterFour/0700~0799/0710.Random-Pick-with-Blacklist.md" >}})Hard33.5%
0728Self Dividing Numbers[Go]({{< relref "/ChapterFour/0700~0799/0728.Self-Dividing-Numbers.md" >}})Easy77.9%
0762Prime Number of Set Bits in Binary Representation[Go]({{< relref "/ChapterFour/0700~0799/0762.Prime-Number-of-Set-Bits-in-Binary-Representation.md" >}})Easy68.0%
0775Global and Local Inversions[Go]({{< relref "/ChapterFour/0700~0799/0775.Global-and-Local-Inversions.md" >}})Medium43.3%
0781Rabbits in Forest[Go]({{< relref "/ChapterFour/0700~0799/0781.Rabbits-in-Forest.md" >}})Medium54.7%
0793Preimage Size of Factorial Zeroes Function[Go]({{< relref "/ChapterFour/0700~0799/0793.Preimage-Size-of-Factorial-Zeroes-Function.md" >}})Hard43.2%
0810Chalkboard XOR Game[Go]({{< relref "/ChapterFour/0800~0899/0810.Chalkboard-XOR-Game.md" >}})Hard55.8%
0812Largest Triangle Area[Go]({{< relref "/ChapterFour/0800~0899/0812.Largest-Triangle-Area.md" >}})Easy59.9%
0836Rectangle Overlap[Go]({{< relref "/ChapterFour/0800~0899/0836.Rectangle-Overlap.md" >}})Easy43.9%
0869Reordered Power of 2[Go]({{< relref "/ChapterFour/0800~0899/0869.Reordered-Power-of-2.md" >}})Medium63.5%
0877Stone Game[Go]({{< relref "/ChapterFour/0800~0899/0877.Stone-Game.md" >}})Medium69.7%
0878Nth Magical Number[Go]({{< relref "/ChapterFour/0800~0899/0878.Nth-Magical-Number.md" >}})Hard35.4%
0887Super Egg Drop[Go]({{< relref "/ChapterFour/0800~0899/0887.Super-Egg-Drop.md" >}})Hard27.1%
0891Sum of Subsequence Widths[Go]({{< relref "/ChapterFour/0800~0899/0891.Sum-of-Subsequence-Widths.md" >}})HardO(n log n)O(1)36.7%
0892Surface Area of 3D Shapes[Go]({{< relref "/ChapterFour/0800~0899/0892.Surface-Area-of-3D-Shapes.md" >}})Easy64.0%
0910Smallest Range II[Go]({{< relref "/ChapterFour/0900~0999/0910.Smallest-Range-II.md" >}})Medium35.2%
0914X of a Kind in a Deck of Cards[Go]({{< relref "/ChapterFour/0900~0999/0914.X-of-a-Kind-in-a-Deck-of-Cards.md" >}})Easy31.2%
0920Number of Music Playlists[Go]({{< relref "/ChapterFour/0900~0999/0920.Number-of-Music-Playlists.md" >}})Hard50.7%
0927Three Equal Parts[Go]({{< relref "/ChapterFour/0900~0999/0927.Three-Equal-Parts.md" >}})Hard39.6%
0952Largest Component Size by Common Factor[Go]({{< relref "/ChapterFour/0900~0999/0952.Largest-Component-Size-by-Common-Factor.md" >}})Hard40.0%
0970Powerful Integers[Go]({{< relref "/ChapterFour/0900~0999/0970.Powerful-Integers.md" >}})Medium43.6%
0973K Closest Points to Origin[Go]({{< relref "/ChapterFour/0900~0999/0973.K-Closest-Points-to-Origin.md" >}})Medium65.7%
0976Largest Perimeter Triangle[Go]({{< relref "/ChapterFour/0900~0999/0976.Largest-Perimeter-Triangle.md" >}})EasyO(n log n)O(log n)54.7%
0989Add to Array-Form of Integer[Go]({{< relref "/ChapterFour/0900~0999/0989.Add-to-Array-Form-of-Integer.md" >}})Easy47.1%
0991Broken Calculator[Go]({{< relref "/ChapterFour/0900~0999/0991.Broken-Calculator.md" >}})Medium54.1%
0996Number of Squareful Arrays[Go]({{< relref "/ChapterFour/0900~0999/0996.Number-of-Squareful-Arrays.md" >}})HardO(n log n)O(n)49.2%
1006Clumsy Factorial[Go]({{< relref "/ChapterFour/1000~1099/1006.Clumsy-Factorial.md" >}})Medium55.5%
1017Convert to Base -2[Go]({{< relref "/ChapterFour/1000~1099/1017.Convert-to-Base-2.md" >}})Medium60.9%
1025Divisor Game[Go]({{< relref "/ChapterFour/1000~1099/1025.Divisor-Game.md" >}})EasyO(1)O(1)67.6%
1030Matrix Cells in Distance Order[Go]({{< relref "/ChapterFour/1000~1099/1030.Matrix-Cells-in-Distance-Order.md" >}})Easy69.7%
1037Valid Boomerang[Go]({{< relref "/ChapterFour/1000~1099/1037.Valid-Boomerang.md" >}})Easy37.0%
1040Moving Stones Until Consecutive II[Go]({{< relref "/ChapterFour/1000~1099/1040.Moving-Stones-Until-Consecutive-II.md" >}})Medium55.9%
1073Adding Two Negabinary Numbers[Go]({{< relref "/ChapterFour/1000~1099/1073.Adding-Two-Negabinary-Numbers.md" >}})Medium36.5%
1093Statistics from a Large Sample[Go]({{< relref "/ChapterFour/1000~1099/1093.Statistics-from-a-Large-Sample.md" >}})Medium43.5%
1104Path In Zigzag Labelled Binary Tree[Go]({{< relref "/ChapterFour/1100~1199/1104.Path-In-Zigzag-Labelled-Binary-Tree.md" >}})Medium75.1%
1137N-th Tribonacci Number[Go]({{< relref "/ChapterFour/1100~1199/1137.N-th-Tribonacci-Number.md" >}})Easy63.7%
1154Day of the Year[Go]({{< relref "/ChapterFour/1100~1199/1154.Day-of-the-Year.md" >}})Easy49.6%
1175Prime Arrangements[Go]({{< relref "/ChapterFour/1100~1199/1175.Prime-Arrangements.md" >}})Easy54.7%
1185Day of the Week[Go]({{< relref "/ChapterFour/1100~1199/1185.Day-of-the-Week.md" >}})Easy57.4%
1201Ugly Number III[Go]({{< relref "/ChapterFour/1200~1299/1201.Ugly-Number-III.md" >}})Medium28.9%
1217Minimum Cost to Move Chips to The Same Position[Go]({{< relref "/ChapterFour/1200~1299/1217.Minimum-Cost-to-Move-Chips-to-The-Same-Position.md" >}})Easy71.9%
1232Check If It Is a Straight Line[Go]({{< relref "/ChapterFour/1200~1299/1232.Check-If-It-Is-a-Straight-Line.md" >}})Easy40.3%
1252Cells with Odd Values in a Matrix[Go]({{< relref "/ChapterFour/1200~1299/1252.Cells-with-Odd-Values-in-a-Matrix.md" >}})Easy78.5%
1266Minimum Time Visiting All Points[Go]({{< relref "/ChapterFour/1200~1299/1266.Minimum-Time-Visiting-All-Points.md" >}})Easy79.1%
1281Subtract the Product and Sum of Digits of an Integer[Go]({{< relref "/ChapterFour/1200~1299/1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer.md" >}})Easy86.6%
1290Convert Binary Number in a Linked List to Integer[Go]({{< relref "/ChapterFour/1200~1299/1290.Convert-Binary-Number-in-a-Linked-List-to-Integer.md" >}})Easy82.1%
1304Find N Unique Integers Sum up to Zero[Go]({{< relref "/ChapterFour/1300~1399/1304.Find-N-Unique-Integers-Sum-up-to-Zero.md" >}})Easy76.9%
1317Convert Integer to the Sum of Two No-Zero Integers[Go]({{< relref "/ChapterFour/1300~1399/1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers.md" >}})Easy55.4%
1442Count 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" >}})Medium76.1%
1486XOR Operation in an Array[Go]({{< relref "/ChapterFour/1400~1499/1486.XOR-Operation-in-an-Array.md" >}})Easy84.6%
1512Number of Good Pairs[Go]({{< relref "/ChapterFour/1500~1599/1512.Number-of-Good-Pairs.md" >}})Easy88.2%
1518Water Bottles[Go]({{< relref "/ChapterFour/1500~1599/1518.Water-Bottles.md" >}})Easy60.5%
1551Minimum Operations to Make Array Equal[Go]({{< relref "/ChapterFour/1500~1599/1551.Minimum-Operations-to-Make-Array-Equal.md" >}})Medium81.5%
1573Number of Ways to Split a String[Go]({{< relref "/ChapterFour/1500~1599/1573.Number-of-Ways-to-Split-a-String.md" >}})Medium32.5%
1641Count Sorted Vowel Strings[Go]({{< relref "/ChapterFour/1600~1699/1641.Count-Sorted-Vowel-Strings.md" >}})Medium77.4%
1648Sell Diminishing-Valued Colored Balls[Go]({{< relref "/ChapterFour/1600~1699/1648.Sell-Diminishing-Valued-Colored-Balls.md" >}})Medium30.4%
1680Concatenation of Consecutive Binary Numbers[Go]({{< relref "/ChapterFour/1600~1699/1680.Concatenation-of-Consecutive-Binary-Numbers.md" >}})Medium57.0%
1685Sum of Absolute Differences in a Sorted Array[Go]({{< relref "/ChapterFour/1600~1699/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array.md" >}})Medium63.5%
1688Count of Matches in Tournament[Go]({{< relref "/ChapterFour/1600~1699/1688.Count-of-Matches-in-Tournament.md" >}})Easy83.1%
1690Stone Game VII[Go]({{< relref "/ChapterFour/1600~1699/1690.Stone-Game-VII.md" >}})Medium58.1%
1716Calculate Money in Leetcode Bank[Go]({{< relref "/ChapterFour/1700~1799/1716.Calculate-Money-in-Leetcode-Bank.md" >}})Easy66.1%
1742Maximum Number of Balls in a Box[Go]({{< relref "/ChapterFour/1700~1799/1742.Maximum-Number-of-Balls-in-a-Box.md" >}})Easy73.6%
2038Remove Colored Pieces if Both Neighbors are the Same Color[Go]({{< relref "/ChapterFour/2000~2099/2038.Remove-Colored-Pieces-if-Both-Neighbors-are-the-Same-Color.md" >}})Medium57.9%
2165Smallest Value of the Rearranged Number[Go]({{< relref "/ChapterFour/2100~2199/2165.Smallest-Value-of-the-Rearranged-Number.md" >}})Medium51.4%
2169Count Operations to Obtain Zero[Go]({{< relref "/ChapterFour/2100~2199/2169.Count-Operations-to-Obtain-Zero.md" >}})Easy75.2%
2180Count Integers With Even Digit Sum[Go]({{< relref "/ChapterFour/2100~2199/2180.Count-Integers-With-Even-Digit-Sum.md" >}})Easy65.5%
2183Count Array Pairs Divisible by K[Go]({{< relref "/ChapterFour/2100~2199/2183.Count-Array-Pairs-Divisible-by-K.md" >}})Hard28.3%
------------------------------------------------------------------------------------------------------------------------------------------------

<div style="display: flex;justify-content: space-between;align-items: center;"> <p><a href="https://books.halfrost.com/leetcode/ChapterTwo/Binary_Search/">⬅️上一页</a></p> <p><a href="https://books.halfrost.com/leetcode/ChapterTwo/Hash_Table/">下一页➡️</a></p> </div>