Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
That's an unconventional way to write a 2-digit year, so I would expect that case to be explicitly called out in the description if that were the intent. I mean, for that matter, the description didn't explictly state that the digits are always in base-10, but you don't find my solution problematic because it doesn't handle input such as "A8F4", do you?
At any rate, I will defer to the test suite, which is the ultimate arbiter for questions such as these.
It could be interpreted that way, but with "0055" it is possible
Year = 55 is not part of the input domain. See the kata description.
Bad solution. Gives "1th" for year=55 instead of "1st"
Very clever! I did not know you could do that in rust
welcome to 1980
No, it's not a tie:
A
pair with7, 6, 4
kickersA
pair with7, 6, 5
kickersAs the kicker
5
outranks4
, P1 loses.See: https://en.wikipedia.org/wiki/Kicker_(poker)
According to the rules of Texas Hold 'em, if both player have the exact same class (except high cards), the highest of the unused cards is relevant (aka the kicker).
c++
Assert::That (run_test ("6S AD 7H 4S AS", "AH AC 5H 6H 7S", Result::Loss)); // "Highest pair wins"
This should result as a Tie, as both have Ace pairs, and both have the same kicker (7)
The unclarification of these rules is simply a burden for the solvers.
In c++ the reversed of this problem is true: The kata states that low aces are not valid, but it does checks on the test
Assert::That (run_test ("2S 3H 4H 5S AC", "AH AC 5H 6H AS", Result::Win )); // "Low-ace straight wins of three of a kind"