Code Challenges

Get better at coding with practice problems.

Coding Challenges

Select a problem, write code, run test cases, and submit your solution.

Showing 19 of 22 problems

Implement the countWaysToReachSumWithDice method that counts dice roll combinations that produce the target sum. Solved

Implement the integerBreakMaximumProduct method that finds the maximum product after splitting an integer into at least two parts. Solved

Implement the countTrailingZerosFactorial method that counts trailing zeroes in the factorial of n. Solved

Implement the isUglyNumber method that checks whether the number has only 2, 3, and 5 as prime factors. Solved

Implement the lcmArrayValues method that returns the least common multiple of all array values. Solved

Implement the sievePrimeCount method that counts prime numbers up to n using sieve-style marking. Solved

Implement the powIntegerFast method that calculates an integer power efficiently using fast exponentiation. Solved

Implement the integerSquareRootFloor method that returns the floor value of the square root of an integer. Solved

Implement the isHappyNumber method that checks whether repeatedly summing the squares of digits reaches 1. Solved

Implement the isPerfectNumber method that checks whether a number is equal to the sum of its proper divisors. Solved

Implement the isArmstrongNumber method that checks whether a number is equal to the sum of its digits raised to the digit count. Solved

Implement the fastPowerModulo method that calculates base raised to exponent under a given modulo efficiently. Solved

Implement the lcmOfTwoNumbers method that returns the least common multiple of two numbers. Solved

Implement the gcdOfTwoNumbers method that returns the greatest common divisor of two numbers. Solved

Intermediate

Implement the countPrimeNumbersUpToN method that counts all prime numbers from 2 up to the given number. Solved

Implement the isPrimeNumber method that checks whether the given number is prime. Solved

Implement the findMissingNumberFromOneToN method that finds the missing value from a sequence that should contain numbers from 1 to n. Solved