diff --git a/docs/README.md b/docs/README.md index d6cd26c4e..007869388 100644 --- a/docs/README.md +++ b/docs/README.md @@ -25,7 +25,7 @@ slug. | [1 kyu](/kata/1-kyu/index.md) | [2 kyu](/kata/2-kyu/index.md) | [3 kyu](/kata/3-kyu/index.md) | [4 kyu](/kata/4-kyu/index.md) | [5 kyu](/kata/5-kyu/index.md) | [6 kyu](/kata/6-kyu/index.md) | [7 kyu](/kata/7-kyu/index.md) | [8 kyu](/kata/8-kyu/index.md) | [beta](/kata/beta/index.md) | [retired](/kata/retired/index.md) | |:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:-----------------------------:|:---------------------------:|:---------------------------------:| -| 0 | 1 | 2 | 26 | 48 | 439 | 603 | 226 | 56 | 82 | +| 0 | 1 | 2 | 26 | 48 | 440 | 603 | 226 | 56 | 82 | **Note:** The source code is written in Java 17 and may use language features that are incompatible with Java 8, 11. diff --git a/kata/6-kyu/death-by-coffee/README.md b/kata/6-kyu/death-by-coffee/README.md new file mode 100644 index 000000000..25a13b632 --- /dev/null +++ b/kata/6-kyu/death-by-coffee/README.md @@ -0,0 +1,64 @@ +# [Death by Coffee](https://www.codewars.com/kata/death-by-coffee "https://www.codewars.com/kata/57db78d3b43dfab59c001abe") + +## Background + +I drink too much coffee. Eventually it will probably kill me. + +*Or will it...?* + +Anyway, there's no way to know. + +*Or is there...?* + +## The Discovery of the Formula + +I proudly announce my discovery of a formula for measuring the life-span of coffee drinkers! + +For + +* ```h``` is a health number assigned to each person (8 digit date of birth YYYYMMDD) +* ```CAFE``` is a cup of *regular* coffee +* ```DECAF``` is a cup of *decaffeinated* coffee + +To determine the life-time coffee limits: + +* Drink cups of coffee (i.e. add to ```h```) until any part of the health number includes `DEAD` +* If the test subject can survive drinking five thousand cups without being ```DEAD``` then coffee has no ill effect on them + +# Kata Task + +Given the test subject's date of birth, return an array describing their life-time coffee limits + +```[ regular limit , decaffeinated limit ]``` + +## Notes + +* The limits are ```0``` if the subject is unaffected as described above + +* At least 1 cup must be consumed (Just thinking about coffee cannot kill you!) + +# Examples + +* John was born 19/Jan/1950 so ```h=19500119```. His coffee limits are ```[2645, 1162]``` which is only about 1 cup per week. You + better cut back John...How are you feeling? You don't look so well. + + +* Susan (11/Dec/1965) is unaffected by decaffeinated coffee, but regular coffee is very bad for her ```[111, 0]```. Just stick to the + decaf Susan. + + +* Elizabeth (28/Nov/1964) is allergic to decaffeinated coffee. Dead after only 11 cups ```[0, 11]```. Read the label carefully Lizzy! + Is it worth the risk? + + +* Peter (4/Sep/1965) can drink as much coffee as he likes ```[0, 0]```. You're a legend Peter!! + +