Categories
Easy Problems

โจทย์เขียนโปรแกรมข้อ VZ0075

จงเขียนฟังก์ชั่นที่รับค่า array ของ integer เข้าไป แล้วส่งค่าผลลัพธ์ที่เกิดจากผลบวกรวมจากค่าของสมาชิกแต่ละตัวยกกำลัง 3 ออกมา

Examples
sumOfCubes([1, 5, 9]) ➞ 855

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

sumOfCubes([2]) ➞ 8

sumOfCubes([]) ➞ 0

เฉลย ด้วยภาษา Python

Leave a Reply