Sum of Cubes

Published by Someone1 in

Create a function that takes in an array of numbers and returns the sum of its cubes.

Examples

CubesSum([1, 5, 9]) ➞ 855
// Since 1^3 + 5^3 + 9^3 = 1 + 125 + 729 = 855

CubesSum([3, 4, 5]) ➞ 216

CubesSum([2]) ➞ 8

Notes

N/A

Watch a quick demo on how Edabit works.