Skip to main content

18 docs tagged with "Number Theory"

View all tags

Add Digits

Given an integer num, repeatedly add all its digits until the result has only one digit, and return it.

Check if Point is Reachable

This document provides a solution where we need to reach the point (targetX, targetY) using a finite number of steps.

Count Primes

This is a solution to the Count Primes problem on LeetCode.

LCM and GCD

This document provides solutions for finding the Least Common Multiple (LCM) and Greatest Common Divisor (GCD) of integers.

Mirror Reflection

Given a square room with mirrored walls and receptors at corners, a laser ray emitted from the southwest corner reflects off mirrors and reaches a receptor based on specified conditions.

Sum Multiples

This is a solution to the Sum Multiples problem on LeetCode.

Ugly Number

This document provides a solution to the Ugly Number problem, where we need to determine if a number is an ugly number.

Ugly Number II

This document provides a solution to the Ugly Number II problem, where we need to find the nth ugly number.