Number Theory: Easy to Hard Problems
Easy
- Fizz Buzz (Prints numbers with Fizz, Buzz, or FizzBuzz based on divisibility)
- Counting Bits (Counts the number of 1s in the binary representation of numbers)
- Power of Two (Checks if a number is a power of two)
- Sqrt(x) (Computes the integer square root of a number)
- Roman to Integer (Converts a Roman numeral to an integer)
Medium
- GCD of Strings (Finds the greatest common divisor of two strings)
- Ugly Number II (Finds the nth ugly number, using prime factorization)
- Factorial Trailing Zeroes (Counts trailing zeroes in the factorial of a number)
- Reverse Integer (Reverses the digits of an integer, handling overflow)
- Maximum Product of Splitted Binary Tree (Finds the maximum product of split binary trees)
Hard
- Integer Replacement (Finds the minimum number of replacements to reduce a number to 1)
- Nth Super Ugly Number (Finds the nth super ugly number with prime factors up to 100)
- Chinese Remainder Theorem (Finds an integer solution to simultaneous congruences)
- Find Minimum in Rotated Sorted Array II (Handles the rotated sorted array with duplicates)
- Count Different Palindromic Subsequences (Counts distinct palindromic subsequences in a string)