Skip to content

Commit 3c6ed56

Browse files
committed
solve: 개미 군단
1 parent 612d8c8 commit 3c6ed56

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function solution(hp) {
2+
const general = 5;
3+
const soldier = 3;
4+
const worker = 1;
5+
6+
const generalCount = Math.floor(hp / general);
7+
const soldierCount = Math.floor((hp % general) / soldier);
8+
const workerCount = ((hp % general) % soldier) / worker;
9+
10+
return generalCount + soldierCount + workerCount;
11+
}

0 commit comments

Comments
 (0)