Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAA solution to last week's challenge can be found here. Source: https://en.wikipedia.org/wiki/Belmont_Stakes
This week's challenge was submitted by @mst3k - Thank you for your submission!
Later this week, the Belmont Stakes will be held in New York. If you are unfamiliar, this is a famous horse race which serves as the third race in the Triple Crown (the Kentucky Derby and Preakness are the other two legs). While there will not be a triple crown winner this year (since different horses won the previous two legs), we can still have some fun analyzing some race possibilities!
A race is being held between 4 horses. Create an output of every possible combination of race finishes. No horse should be able to finish in more than 1 place, but be warned there are two *different* mustangs named Sally in this race!
Extra Credit: If there are 5 horses instead of 4, how many possible outcomes are there? Can that number be generalized if there are n number of horses?
@estherb47 Does this bring back nightmares of Born to Solve Nashville?
And to solve the advanced part/make it more dynamic without macros, we can simulate enough horse races to get all the possible outcomes
fun fact: race horse names cannot be reused until 5 years after the horse has stopped racing or breeding
I believe the number of solutions for this problem is just a simple factorial? So it should generalize to any number of starters.