Tag: number theory
We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, write a …
Find the least number of perfect square numbers (1, 4, 9, 16, 25 …) which sum to the given integer n. For example, given n = 5, return 2 …
Given an integer n, return the number of trailing zeroes in Factorial N! Your solution should be in logarithmic time complexity. Naive/Bruteforce Solution It is easy to get the …
Question: Given an array and a element, remove all instances of that value in place and return the new length. The order of elements can be changed and it …
Question: You are climbing stairs. It takes n steps to get to the top. Each time, you can take 1 step or 2 steps. How many distinct ways to get to …