Math | LeetCode Problems

264 Math solutions to LeetCode solutions.

Math Problems View all solutions →

Add Two Numbers

#2 Medium

Reverse Integer

#7 Easy

Palindrome Number

#9 Easy

Integer to Roman

#12 Medium

Roman to Integer

#13 Easy

Divide Two Integers

#29 Medium

Multiply Strings

#43 Medium

Rotate Image

#48 Medium

Pow(x, n)

#50 Medium

Permutation Sequence

#60 Hard

Unique Paths

#62 Medium

Plus One

#66 Easy

Add Binary

#67 Easy

Sqrt(x)

#69 Medium

Climbing Stairs

#70 Easy

Gray Code

#89 Medium

Unique Binary Search Trees

#96 Medium

Max Points on a Line

#149 Hard

Evaluate Reverse Polish Notation

#150 Medium

Fraction to Recurring Decimal

#166 Medium

Excel Sheet Column Title

#168 Easy

Excel Sheet Column Number

#171 Easy

Factorial Trailing Zeroes

#172 Medium

Rotate Array

#189 Medium

Happy Number

#202 Easy

Count Primes

#204 Medium

Rectangle Area

#223 Medium

Basic Calculator

#224 Hard

Basic Calculator II

#227 Medium

Power of Two

#231 Easy

Number of Digit One

#233 Hard

Different Ways to Add Parentheses

#241 Medium

Add Digits

#258 Easy

Ugly Number

#263 Easy

Ugly Number II

#264 Medium

Missing Number

#268 Easy

Integer to English Words

#273 Hard

Perfect Squares

#279 Medium

Expression Add Operators

#282 Hard

Nim Game

#292 Easy

Super Ugly Number

#313 Medium

Bulb Switcher

#319 Medium

Power of Three

#326 Easy

Self Crossing

#335 Hard

Power of Four

#342 Easy

Integer Break

#343 Medium

Count Numbers with Unique Digits

#357 Medium

Water and Jug Problem

#365 Medium

Valid Perfect Square

#367 Easy

Largest Divisible Subset

#368 Medium

Sum of Two Integers

#371 Medium

Super Pow

#372 Medium

Guess Number Higher or Lower II

#375 Medium

Insert Delete GetRandom O(1)

#380 Medium

Insert Delete GetRandom O(1) - Duplicates allowed

#381 Hard

Linked List Random Node

#382 Medium

Shuffle an Array

#384 Medium

Elimination Game

#390 Medium

Rotate Function

#396 Medium

Random Pick Index

#398 Medium

Nth Digit

#400 Medium

Convert a Number to Hexadecimal

#405 Easy

Fizz Buzz

#412 Easy

Add Strings

#415 Easy

Reconstruct Original Digits from English

#423 Medium

Arranging Coins

#441 Easy

Add Two Numbers II

#445 Medium

Number of Boomerangs

#447 Medium

Minimum Moves to Equal Array Elements

#453 Medium

Poor Pigs

#458 Hard

Minimum Moves to Equal Array Elements II

#462 Medium

Can I Win

#464 Medium

Implement Rand10() Using Rand7()

#470 Medium

Total Hamming Distance

#477 Medium

Generate Random Point in a Circle

#478 Medium

Largest Palindrome Product

#479 Hard

Smallest Good Base

#483 Hard

Predict the Winner

#486 Medium

Construct the Rectangle

#492 Easy

Random Point in Non-overlapping Rectangles

#497 Medium

Base 7

#504 Easy

Perfect Number

#507 Easy

Fibonacci Number

#509 Easy

Random Flip Matrix

#519 Medium

Continuous Subarray Sum

#523 Medium

Random Pick with Weight

#528 Medium

Complex Number Multiplication

#537 Medium

Minimum Time Difference

#539 Medium

Optimal Division

#553 Medium

Next Greater Element III

#556 Medium

Find the Closest Palindrome

#564 Hard

Erect the Fence

#587 Hard

Fraction Addition and Subtraction

#592 Medium

Valid Square

#593 Medium

Range Addition II

#598 Easy

Maximum Product of Three Numbers

#628 Easy

Sum of Square Numbers

#633 Medium

Solve the Equation

#640 Medium

2 Keys Keyboard

#650 Medium

Beautiful Arrangement II

#667 Medium

Kth Smallest Number in Multiplication Table

#668 Hard

Maximum Swap

#670 Medium

Bulb Switcher II

#672 Medium

24 Game

#679 Hard

Random Pick with Blacklist

#710 Hard

Self Dividing Numbers

#728 Easy

Monotone Increasing Digits

#738 Medium

Reach a Number

#754 Medium

Prime Number of Set Bits in Binary Representation

#762 Easy

Basic Calculator IV

#770 Hard

Global and Local Inversions

#775 Medium

K-th Symbol in Grammar

#779 Medium

Reaching Points

#780 Hard

Rabbits in Forest

#781 Medium

Transform to Chessboard

#782 Hard

Rotated Digits

#788 Medium

Escape The Ghosts

#789 Medium

Preimage Size of Factorial Zeroes Function

#793 Hard

Split Array With Same Average

#805 Hard

Soup Servings

#808 Medium

Chalkboard XOR Game

#810 Hard

Largest Triangle Area

#812 Easy

Consecutive Numbers Sum

#829 Hard

Rectangle Overlap

#836 Easy

New 21 Game

#837 Medium

Magic Squares In Grid

#840 Medium

Guess the Word

#843 Hard

Mirror Reflection

#858 Medium

Prime Palindrome

#866 Medium

Reordered Power of 2

#869 Medium

Stone Game

#877 Medium

Nth Magical Number

#878 Hard

Projection Area of 3D Shapes

#883 Easy

Super Egg Drop

#887 Hard

Sum of Subsequence Widths

#891 Hard

Surface Area of 3D Shapes

#892 Easy

Orderly Queue

#899 Hard

Numbers At Most N Given Digit Set

#902 Hard

Super Palindromes

#906 Hard

Smallest Range I

#908 Easy

Smallest Range II

#910 Medium

Cat and Mouse

#913 Hard

X of a Kind in a Deck of Cards

#914 Medium

Number of Music Playlists

#920 Hard

Three Equal Parts

#927 Hard

Beautiful Array

#932 Medium

Minimum Area Rectangle

#939 Medium

Largest Component Size by Common Factor

#952 Hard

Prison Cells After N Days

#957 Medium

Minimum Area Rectangle II

#963 Medium

Least Operators to Express Number

#964 Hard

Powerful Integers

#970 Easy

Equal Rational Numbers

#972 Hard

K Closest Points to Origin

#973 Medium

Largest Perimeter Triangle

#976 Easy

Add to Array-Form of Integer

#989 Easy

Broken Calculator

#991 Medium

Number of Squareful Arrays

#996 Hard

Clumsy Factorial

#1006 Medium

Numbers With Repeated Digits

#1012 Hard

Smallest Integer Divisible by K

#1015 Medium

Convert to Base -2

#1017 Medium

Divisor Game

#1025 Easy

Matrix Cells in Distance Order

#1030 Easy

Moving Stones Until Consecutive

#1033 Medium

Valid Boomerang

#1037 Easy

Moving Stones Until Consecutive II

#1040 Medium

Robot Bounded In Circle

#1041 Medium

Greatest Common Divisor of Strings

#1071 Easy

Adding Two Negabinary Numbers

#1073 Medium

Statistics from a Large Sample

#1093 Medium

Distribute Candies to People

#1103 Easy

Path In Zigzag Labelled Binary Tree

#1104 Medium

Maximum of Absolute Value Expression

#1131 Medium

N-th Tribonacci Number

#1137 Easy

Stone Game II

#1140 Medium

Day of the Year

#1154 Easy

Prime Arrangements

#1175 Easy

Day of the Week

#1185 Easy

Ugly Number III

#1201 Medium

Minimum Cost to Move Chips to The Same Position

#1217 Easy

Airplane Seat Assignment Probability

#1227 Medium

Check If It Is a Straight Line

#1232 Easy

Find Positive Integer Solution for a Given Equation

#1237 Medium

Circular Permutation in Binary Representation

#1238 Medium

Minimum Swaps to Make Strings Equal

#1247 Medium

Count Number of Nice Subarrays

#1248 Medium

Check If It Is a Good Array

#1250 Hard

Cells with Odd Values in a Matrix

#1252 Easy

Minimum Time Visiting All Points

#1266 Easy

Number of Burgers with No Waste of Ingredients

#1276 Medium

Subtract the Product and Sum of Digits of an Integer

#1281 Easy

Convert Binary Number in a Linked List to Integer

#1290 Easy

Find Numbers with Even Number of Digits

#1295 Easy

Find N Unique Integers Sum up to Zero

#1304 Easy

Verbal Arithmetic Puzzle

#1307 Hard

Convert Integer to the Sum of Two No-Zero Integers

#1317 Easy

Maximum 69 Number

#1323 Easy

Reverse Subarray To Maximize Array Value

#1330 Hard

Number of Steps to Reduce a Number to Zero

#1342 Easy

Angle Between Hands of a Clock

#1344 Medium

Product of the Last K Numbers

#1352 Medium

Count All Valid Pickup and Delivery Options

#1359 Hard

Number of Days Between Two Dates

#1360 Easy

Closest Divisors

#1362 Medium

Largest Multiple of Three

#1363 Hard

Four Divisors

#1390 Medium

Count Largest Group

#1399 Easy

Circle and Rectangle Overlapping

#1401 Medium

Stone Game III

#1406 Hard

Find the Minimum Number of Fibonacci Numbers Whose Sum Is K

#1414 Medium

Max Difference You Can Get From Changing an Integer

#1432 Medium

Count Triplets That Can Form Two Arrays of Equal XOR

#1442 Medium

Simplified Fractions

#1447 Medium

Maximum Number of Darts Inside of a Circular Dartboard

#1453 Hard

Probability of a Two Boxes Having The Same Number of Distinct Balls

#1467 Hard

Allocate Mailboxes

#1478 Hard

XOR Operation in an Array

#1486 Easy

The kth Factor of n

#1492 Medium

Stone Game IV

#1510 Hard

Number of Good Pairs

#1512 Easy

Number of Substrings With Only 1s

#1513 Medium

Best Position for a Service Centre

#1515 Hard

Water Bottles

#1518 Easy

Count Odd Numbers in an Interval Range

#1523 Easy

Number of Sub-arrays With Odd Sum

#1524 Medium

Minimum Operations to Make Array Equal

#1551 Medium

Maximum Number of Coins You Can Get

#1561 Medium

Stone Game V

#1563 Hard

Number of Ways to Reorder Array to Get Same BST

#1569 Hard

Number of Ways to Split a String

#1573 Medium

Number of Ways Where Square of Number Is Equal to Product of Two Numbers

#1577 Medium

Sum of All Odd Length Subarrays

#1588 Easy

Maximum Number of Visible Points

#1610 Hard

Number of Sets of K Non-Overlapping Line Segments

#1621 Medium

Fancy Sequence

#1622 Hard

Graph Connectivity With Threshold

#1627 Hard

Count Sorted Vowel Strings

#1641 Medium

Kth Smallest Instructions

#1643 Hard

Sell Diminishing-Valued Colored Balls

#1648 Medium

Calculate Money in Leetcode Bank

#1716 Easy

Check if Number is a Sum of Powers of Three

#1780 Medium

Determine Color of a Chessboard Square

#1812 Easy

Sum of All Subset XOR Totals

#1863 Easy

Count Good Numbers

#1922 Medium

Minimum Operations to Make a Uni-Value Grid

#2033 Medium

Add Two Integers

#2235 Easy

Count the Number of Ideal Arrays

#2338 Hard

Count Number of Bad Pairs

#2364 Medium

Strictly Palindromic Number

#2396 Medium

Smallest Even Multiple

#2413 Easy

Number of Common Factors

#2427 Easy

Convert the Temperature

#2469 Easy

Closest Prime Numbers in Range

#2523 Medium

Difference Between Element Sum and Digit Sum of an Array

#2535 Easy

Count Total Number of Colored Cells

#2579 Medium

Find the Punishment Number of an Integer

#2698 Medium

Apply Operations to Maximize Score

#2818 Hard

Count Symmetric Integers

#2843 Easy

Find Missing and Repeated Values

#2965 Easy

Count the Number of Powerful Integers

#2999 Hard

Find the Count of Good Integers

#3272 Hard

Check If Digits Are Equal in String After Operations I

#3461 Easy

Check If Digits Are Equal in String After Operations II

#3463 Hard