Number Theory | LeetCode Problems

42 Number Theory solutions to LeetCode solutions.

Number Theory Problems View all solutions →

Count Primes

#204 Medium

Add Digits

#258 Easy

Mirror Reflection

#858 Medium

Prime Palindrome

#866 Medium

X of a Kind in a Deck of Cards

#914 Medium

Largest Component Size by Common Factor

#952 Hard

Ugly Number III

#1201 Medium

Check If It Is a Good Array

#1250 Hard

Simplified Fractions

#1447 Medium

The kth Factor of n

#1492 Medium

Graph Connectivity With Threshold

#1627 Hard

Count Ways to Make Array With Product

#1735 Hard

Tree of Coprimes

#1766 Hard

Maximize Score After N Operations

#1799 Hard

Maximize Number of Nice Divisors

#1808 Hard

Number of Different Subsequences GCDs

#1819 Hard

Three Divisors

#1952 Easy

Find Greatest Common Divisor of Array

#1979 Easy

GCD Sort of an Array

#1998 Hard

Number of Pairs of Interchangeable Rectangles

#2001 Medium

Count Array Pairs Divisible by K

#2183 Hard

Replace Non-Coprime Numbers in Array

#2197 Hard

Minimum Lines to Represent a Line Chart

#2280 Medium

Count the Number of Ideal Arrays

#2338 Hard

Smallest Even Multiple

#2413 Easy

Number of Common Factors

#2427 Easy

Number of Subarrays With GCD Equal to K

#2447 Medium

Number of Subarrays With LCM Equal to K

#2470 Medium

Smallest Value After Replacing With Sum of Prime Factors

#2507 Medium

Distinct Prime Factors of Product of Array

#2521 Medium

Closest Prime Numbers in Range

#2523 Medium

Check if Point Is Reachable

#2543 Hard

Prime Subtraction Operation

#2601 Medium

Greatest Common Divisor Traversal

#2709 Hard

Number of Beautiful Pairs

#2748 Easy

Insert Greatest Common Divisors in Linked List

#2807 Medium

Apply Operations to Maximize Score

#2818 Hard

Maximum Element-Sum of a Complete Subset of Indices

#2862 Hard

Count Beautiful Substrings I

#2947 Medium

Most Frequent Prime

#3044 Medium

Check If Digits Are Equal in String After Operations I

#3461 Easy

Check If Digits Are Equal in String After Operations II

#3463 Hard