We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 612d8c8 commit 3c6ed56Copy full SHA for 3c6ed56
sgoldenbird/level_0/개미_군단.js
@@ -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