← Back to challenges

Product Divisible by Sum?

JavaScriptHardnumbersarraysvalidationmath

Instructions

Write a function that returns true if the product of an array is divisible by the sum of that same array. Otherwise, return false.

Examples

divisible([3, 2, 4, 2]) ➞ false

divisible([4, 2, 6]) ➞ true
// 4 * 2 * 6 / (4 + 2 + 6)

divisible([3, 5, 1]) ➞ false

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Where is Bob!?!