Coding Test/프로그래머스
[프로그래머스/js] 피자 나눠 먹기(1)
danii0110
2023. 3. 26. 13:25
내 풀이
function solution(n) {
return n%7===0 ? Math.floor(n/7) : Math.floor(n/7)+1;
}
삼항 연산자
Math.floor()
: 소수점 이하를 버림한다