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 355 problems
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 mergeTwoSortedArrays method that merges two sorted arrays into one sorted result array. Solved

Implement the findFirstRepeatedValue method that returns the first value that appears more than once while scanning the array. Solved

Implement the maximumSubarraySumFixedLength method that finds the maximum sum of any contiguous subarray of length k. Solved