Number Theory Problems

Master number theory problems with AI-powered solutions. Get instant coding assistance during your technical interviews for all 43 problems in this category.

Total Problems: 43
Easy: 9
Medium: 22
Hard: 12
Showing 43 of 43 problems

Problems

Scroll within this area to browse all problems

#
Title
Difficulty
204

Count Primes

Medium
2106

Find Greatest Common Divisor of Array

Easy
258

Add Digits

Easy
2670

Make K-Subarray Sums Equal

Medium
2609

Distinct Prime Factors of Product of Array

Medium
888

Mirror Reflection

Medium
2083

Three Divisors

Easy
1585

The kth Factor of n

Medium
1223

Graph Connectivity With Threshold

Hard
3552

Find the Largest Palindrome Divisible by K

Hard
3697

Minimum Increments for Target Multiples in an Array

Hard
3936

Split Array by Prime Indices

Medium
3373

Maximum Prime Difference

Medium
3907

Count Prime-Gap Balanced Subarrays

Medium
3920

Minimum Stability Factor of Array

Hard
3933

Minimum Jumps to Reach End via Prime Teleportation

Medium
1543

Simplified Fractions

Medium
3702

Maximum Subarray With Equal Products

Easy
1307

Ugly Number III

Medium
2628

Minimize the Maximum of Two Arrays

Medium
2557

Number of Subarrays With LCM Equal to K

Medium
2415

Count the Number of Ideal Arrays

Hard
2827

Greatest Common Divisor Traversal

Hard
3914

Check if Any Element Has Prime Frequency

Easy
2423

Minimum Deletions to Make Array Divisible

Hard
3815

Sum of Largest Prime Substrings

Medium
3774

Check If Digits Are Equal in String After Operations II

Hard
2129

Number of Pairs of Interchangeable Rectangles

Medium
3878

Maximize Count of Distinct Primes After Split

Hard
2507

Number of Common Factors

Easy
2722

Prime In Diagonal

Easy
3112

Count Valid Paths in a Tree

Hard
897

Prime Palindrome

Medium
2367

Minimum Lines to Represent a Line Chart

Medium
950

X of a Kind in a Deck of Cards

Easy
2873

Prime Pairs With Target Sum

Medium
1875

Tree of Coprimes

Hard
1372

Check If It Is a Good Array

Hard
2610

Closest Prime Numbers in Range

Medium
2716

Prime Subtraction Operation

Medium
3607

Minimum Division Operations to Make Array Non Decreasing

Medium
2491

Smallest Even Multiple

Easy
2903

Insert Greatest Common Divisors in Linked List

Medium

Number Theory LeetCode Problems List

Related LeetCode Topics

Number Theory LeetCode Problems - Interview Coder