Continuing the discussion from CodeFights - Become a Code Champion:
Lên vọc thử thì thấy cái này, chắc là dễ với mấy bạn giỏi. Đạt thì bó tay rồi. Ai sửa dùm cái này lỗi chỗ nào vậy?
/**
* @Input: a positive integer
* @Output: sum of cubes of all integers
* from 1 to and including @Input
* @Example:
* sumOfCubes(3) = 36
*/
function sumOfCubes(n) {
var result = 1;
for (var i=1; i <= n; i++){
result += i * i * i;
}
return result;
}