avatar_url

Sandesh Rana | Python

I'm a developer from Himalayas, with a passion for crafting efficient and elegant code, with creativity and precision.

Number Theory

21 Aug 2024 » programming, algorithm

Number Theory: Easy to Hard Problems

Easy

  1. Fizz Buzz (Prints numbers with Fizz, Buzz, or FizzBuzz based on divisibility)
  2. Counting Bits (Counts the number of 1s in the binary representation of numbers)
  3. Power of Two (Checks if a number is a power of two)
  4. Sqrt(x) (Computes the integer square root of a number)
  5. Roman to Integer (Converts a Roman numeral to an integer)

Medium

  1. GCD of Strings (Finds the greatest common divisor of two strings)
  2. Ugly Number II (Finds the nth ugly number, using prime factorization)
  3. Factorial Trailing Zeroes (Counts trailing zeroes in the factorial of a number)
  4. Reverse Integer (Reverses the digits of an integer, handling overflow)
  5. Maximum Product of Splitted Binary Tree (Finds the maximum product of split binary trees)

Hard

  1. Integer Replacement (Finds the minimum number of replacements to reduce a number to 1)
  2. Nth Super Ugly Number (Finds the nth super ugly number with prime factors up to 100)
  3. Chinese Remainder Theorem (Finds an integer solution to simultaneous congruences)
  4. Find Minimum in Rotated Sorted Array II (Handles the rotated sorted array with duplicates)
  5. Count Different Palindromic Subsequences (Counts distinct palindromic subsequences in a string)