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.
So, that's it! Thanks, now totally explained.
In all of the initial tests Hands are created, tested once and then freed. That let me to the assumption that it would always be that way. My mistake. Thanks again.
Thanks, but that result would be expected - buildTracker() should indeed set values into the tracker field.
Let's use your test approach, but before any calls to buildTracker:
Output includes:
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Seems not fixed to me. I was given the test:
"JC 6H JS JD JH", "JC 7H JS JD JH"
Both hands contain 4 Jacks. For this to be possible, there would have to be at least two decks of cards in use. To be fair, the description does not specify whether a single deck of cards is used, but I think most people would assume that's the case.
I agree, the correct solution for 96682790625023136 is { 9668279062523136, 11, 0 }
Tested with large random integers, this seems to be about 100 times the speed of some solutions here - those using strings and brute force.
Thanks for the feedback. I was running your code to test it... maybe I made a mistake and forgot to compile and it was somebody else's code :) I'll check again when I've got a moment.
Despite passing tests here, this solution is flawed. I'll fix it when I get a moment.
Try testing all possible moves - you will find it fails on 8 of them.
If you test it with all possible moves, you will find it fails 8 of them, returning 2 when it should be 4.
Sorry to say, it fails on 4 tests:
Fail: b7 to a8 - returned 2 should be 4
Fail: b8 to a7 - returned 4 should be 2
Fail: g7 to h8 - returned 2 should be 4
Fail: g8 to h7 - returned 4 should be 2