You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good morning! Here's your coding interview problem for today.
This problem was asked by WeWork.
You are given an array of integers representing coin denominations and a total amount of money. Write a function to compute the fewest number of coins needed to make up that amount. If it is not possible to make that amount, return null.
For example, given an array of [1,5, 10] and an amount 56, return 7 since we can use 5 dimes, 1 nickel, and 1 penny.
Given an array of [5, 8] and an amount 15, return 3 since we can use 5 5-cent coins.
The text was updated successfully, but these errors were encountered:
Good morning! Here's your coding interview problem for today.
This problem was asked by WeWork.
You are given an array of integers representing coin denominations and a total amount of money. Write a function to compute the fewest number of coins needed to make up that amount. If it is not possible to make that amount, return null.
For example, given an array of
[1,5, 10]
and an amount56
, return7
since we can use 5 dimes, 1 nickel, and 1 penny.Given an array of
[5, 8]
and an amount15
, return3
since we can use 5 5-cent coins.The text was updated successfully, but these errors were encountered: