8000 docs: add greed solution · benmtz/codewars-python@6ebf20e · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ebf20e

Browse files
committed
docs: add greed solution
1 parent c9e5a20 commit 6ebf20e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

katas/5-greed-is-good.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ def extract_score(counts, dice_value, dice_count, value):
3939
result += value
4040
return result
4141

42+
# Best one from solutions --> there is a count method
43+
# def score(dice):
44+
# return dice.count(1)//3 * 1000 + dice.count(1)%3 * 100 \
45+
# + dice.count(2)//3 * 200 \
46+
# + dice.count(3)//3 * 300 \
47+
# + dice.count(4)//3 * 400 \
48+
# + dice.count(5)//3 * 500 + dice.count(5)%3 * 50 \
49+
# + dice.count(6)//3 * 600 \
50+
4251

4352
def score(dice):
4453
result = 0

0 commit comments

Comments
 (0)
0