[프로그래머스] 개미 군단 (javascript)

몽슈뜨·2023년 1월 6일
0

programmers

목록 보기
46/62
post-thumbnail

🎯나의 풀이

function solution(hp) {
  const a = Math.floor(hp / 5)
  const b = Math.floor((hp - a * 5 ) / 3)
  const c = Math.floor(hp - a * 5 - b * 3)

  return a + b + c
}
profile
개발자되면 맥북사줄께

0개의 댓글