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.
the pattern that you only needed to do two sides, this is the most impressive solution I've seen
this dude charges by the line...
Curious about stats on my profile... it says the highest Kata I've trained is 4, but on my list of kata there's clearly a 1 sitting in the list. Bug?
This comment is hidden because it contains spoiler information about the solution
many thanks trevdoz, indeed I needed to use a sledge hammer rather than a scalpel to define the words
nice, makes sense. coding for undescribed requirements, sexy :)
random tests on this are failing on me with Incorrect frequencies expected:<[29, 27, 18]> but was:<[27, 29, 14]>
...output is completely opaque as to what input was being tested and what it's even expecting. all the regular tests pass.
In JS at least, the test cases completely ignore "the wheel"; the straight from ace to 5.
These tests should pass:
Almost all solutions are not looking for it. Without this check, this straight loses to even a high card (ace and anything over a 5), a basic pair, everything. Example, A2345 should soundly beat A3456 (busted straight) and everything up to trips, without the check it loses to most things.
...even the solutions marked "best practice" don't do it, which is quite funny really. "Best practice" on this site, really doesn't mean what people thinks it means :)
the clever votes are fine, but people voting "best practice" on this site either aren't looking at the other solutions or not much of an idea about computing overhead...
this solution has n² compute time and memory; every position re-runs the array count, and the counting done by making new arrays and the call stack.
whereas managing counts in a dictionary is n.
I mean no ill to the author, it's nice to look at as a piece of code, a cool alternative, I'm fine with it being marked as clever, I really am.
cross character, nice. you might like to use the french accented 'í' instead of an i... anyone maintaining the code will go insane ;)
I think people get too worked up over the 'Best Practices' button... dude was clearly golfing, and golfing is amusing and he did well. if he wants to golf, let him golf :)