Category: math
Numbers can be regarded as product of its factors. For example, 8 = 2 x 2 x 2; = 2 x 4. Write a function that takes an integer …
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. The same …
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make …
Given an array, we want to shuffle it (to make it random), so that every possible random solution gets evenly-distributely possibility. One may quickly write a solution like this, …
We know the binary conversion, which is base two. The algorithm to convert to binary for a decimal integer, is to divide by two and concatenate the remainder in …