Added solution for Project Euler problem 109#4080
Merged
dhruvmanila merged 3 commits intoTheAlgorithms:masterfrom Mar 6, 2021
fpringle:problem_109
Merged
Added solution for Project Euler problem 109#4080dhruvmanila merged 3 commits intoTheAlgorithms:masterfrom fpringle:problem_109
dhruvmanila merged 3 commits intoTheAlgorithms:masterfrom
fpringle:problem_109
Conversation
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Contributor
Author
|
@dhruvmanila @Kush1101 When you've got a second :) |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Contributor
Author
|
@dhruvmanila @Kush1101 bump |
dhruvmanila
requested changes
Mar 6, 2021
Member
dhruvmanila
left a comment
There was a problem hiding this comment.
Sorry for not responding. Just a small change and this will be good to go!
dhruvmanila
approved these changes
Mar 6, 2021
peRFectBeliever
pushed a commit
to peRFectBeliever/Python
that referenced
this pull request
Apr 1, 2021
* Added solution for Project Euler problem 109
* New subscriptable builtin types
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Panquesito7
pushed a commit
to Panquesito7/Python
that referenced
this pull request
May 13, 2021
* Added solution for Project Euler problem 109
* New subscriptable builtin types
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
shermanhui
pushed a commit
to shermanhui/Python
that referenced
this pull request
Oct 22, 2021
* Added solution for Project Euler problem 109
* New subscriptable builtin types
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your change:
Project Euler problem 109: Darts
In the game of darts a player throws three darts at a target board which is split into twenty equal sized sections numbered one to twenty.

The score of a dart is determined by the number of the region that the dart lands in. A dart landing outside the red/green outer ring scores zero. The black and cream regions inside this ring represent single scores. However, the red/green outer ring and middle ring score double and treble scores respectively.
At the centre of the board are two concentric circles called the bull region, or bulls-eye. The outer bull is worth 25 points and the inner bull is a double, worth 50 points.
There are many variations of rules but in the most popular game the players will begin with a score 301 or 501 and the first player to reduce their running total to zero is a winner. However, it is normal to play a "doubles out" system, which means that the player must land a double (including the double bulls-eye at the centre of the board) on their final dart to win; any other dart that would reduce their running total to one or lower means the score for that set of three darts is "bust".
When a player is able to finish on their current score it is called a "checkout" and the highest checkout is 170: T20 T20 D25 (two treble 20s and double bull).
There are exactly eleven distinct ways to checkout on a score of 6:
D3
D1 D2
S2 D2
D2 D1
S4 D1
S1 S1 D2
S1 T1 D1
S1 S3 D1
D1 D1 D1
D1 S2 D1
S2 S2 D1
Note that D1 D2 is considered different to D2 D1 as they finish on different doubles. However, the combination S1 T1 D1 is considered the same as T1 S1 D1.
In addition we shall not include misses in considering combinations; for example, D3 is the same as 0 D3 and 0 0 D3.
Incredibly there are 42336 distinct ways of checking out in total.
How many distinct ways can a player checkout with a score less than 100?
Checklist:
Fixes: #{$ISSUE_NO}.