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 65 problems

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

Implement the maximumProductCutting method that finds the maximum product obtainable by cutting an integer into parts. 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

Intermediate

Implement the nCrValue method that calculates the binomial coefficient value nCr. 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

Implement the method coinChangeMinCoins that returns the minimum number of coins needed for an amount. Solved

Learner

Implement the method productSign that returns the sign of the product of an integer array. Solved

Beginner

Implement the method celsiusToFahrenheit that converts Celsius to Fahrenheit. Solved