function solution(box, n) {
var answer = 0;
answer = Math.floor(box[0]/n) * Math.floor(box[1]/n) * Math.floor(box[2]/n)
return answer;
}
box
배열에서 값을 인덱스 값으로 접근해서 풀었다.function solution(box, n) {
let [width, length, height] = box;
return Math.floor(width / n) * Math.floor(length / n) * Math.floor(height / n);
}
let [width, length, height] = box
로 width
, length
, height
에 값을 지정할 수 있었다.