Product Divisible by Sum?

Published by Helen Yu in

Write a function that returns true if the product of a vector is divisible by the sum of that same vector. 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

Watch a quick demo on how Edabit works.