Skip to content

Commit d87c75f

Browse files
* docs: kata description * feat: kata/boiled-eggs --------- Co-authored-by: ParanoidUser <5120290+ParanoidUser@users.noreply.github.com>
1 parent d12157a commit d87c75f

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

kata/7-kyu/boiled-eggs/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# [Boiled Eggs](https://www.codewars.com/kata/boiled-eggs "https://www.codewars.com/kata/52b5247074ea613a09000164")
2+
3+
You are the greatest chef on earth. No one boils eggs like you! Your restaurant is always full of guests, who love your boiled eggs. But
4+
when there is a greater order of boiled eggs, you need some time, because you have only one pot for your job. How much time do you need?
5+
6+
## Your Task
7+
8+
Implement a function, which takes a non-negative integer, representing the number of eggs to boil. It must return the time in minutes (
9+
integer), which it takes to have all the eggs boiled.
10+
11+
## Rules
12+
13+
* you can put at most 8 eggs into the pot at once
14+
* it takes 5 minutes to boil an egg
15+
* we assume, that the water is boiling all the time (no time to heat up)
16+
* for simplicity, we also don't consider the time it takes to put eggs into the pot or get them out of it
17+
18+
## Example (Input --> Output)
19+
20+
```
21+
0 --> 0
22+
5 --> 5
23+
10 --> 10
24+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
interface BoilingWater{
2+
static int cookingTime(int eggs) {
3+
return (eggs + 7) / 8 * 5;
4+
}
5+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import static org.junit.jupiter.api.Assertions.assertEquals;
2+
3+
import org.junit.jupiter.params.ParameterizedTest;
4+
import org.junit.jupiter.params.provider.CsvSource;
5+
6+
class SolutionTest {
7+
@ParameterizedTest
8+
@CsvSource(textBlock = """
9+
0, 0
10+
5, 5
11+
10, 10
12+
90072355, 56295225
13+
""")
14+
void sample(int eggs, int time) {
15+
assertEquals(time, BoilingWater.cookingTime(eggs));
16+
}
17+
}

kata/7-kyu/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
- [Bits Battle](bits-battle "58856a06760b85c4e6000055")
5858
- [Blood Moon](blood-moon "5cba04533e6dce000eaf6126")
5959
- [Blowing Birthday Candles](blowing-birthday-candles "6630da20f925eb3007c5a498")
60+
- [Boiled Eggs](boiled-eggs "52b5247074ea613a09000164")
6061
- [Breaking chocolate problem](breaking-chocolate-problem "534ea96ebb17181947000ada")
6162
- [Broken sequence](broken-sequence "5512e5662b34d88e44000060")
6263
- [Bubblesort Once](bubblesort-once "56b97b776ffcea598a0006f2")

0 commit comments

Comments
 (0)