6 kyu
Sum of dices
166NikosAthens
Description:
You have n
dices each one having s
sides numbered from 1 to s
.
How many outcomes add up to a specified number k
?
For example if we roll four normal six-sided dices we have four outcomes that add up to 5.
(1, 1, 1, 2) (1, 1, 2, 1) (1, 2, 1, 1) (2, 1, 1, 1)
There are 100 random tests with:
0 <= n <= 10
1 <= s <= 20
0 <= k <= n * s
Notes:
- there is always exactly 1 case to reach
k = 0
regardless of the number of dice you have - without any dice, it's not possible to reach any positive
k
Algorithms
Fundamentals
Similar Kata:
Stats:
Created | Apr 25, 2017 |
Published | Apr 25, 2017 |
Warriors Trained | 802 |
Total Skips | 15 |
Total Code Submissions | 1077 |
Total Times Completed | 166 |
Python Completions | 166 |
Total Stars | 25 |
% of votes with a positive feedback rating | 91% of 55 |
Total "Very Satisfied" Votes | 46 |
Total "Somewhat Satisfied" Votes | 8 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 6 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |