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.
Cheater))
Thanks, I added a note guaranteeing that the input array will contain all runners in their order of finish excepting null
resultRank
s, which will always be at the end if present! I do this to match the example inputs on the World Athletics site here, not trying to cop-out!Thanks, fixed!
@JohanWiltink My mistake, I just tested and the correct initial solution is displaying now!
Inputs are not specified to be in order of
resultRank
, but some solutions depend on this.Needs additional testing. ( Or specification that input will be in that order. But that'd be a cop-out. :P )
Random tests are vulnerable to input modification. Please compute the expected value first.
No, it isn't ( yes, I refreshed ).
Initial solution should not have function
twoOldestAges
; it should havescoreWorldXC
( with an appropriately named argument ).Thanks, done!
Thanks, fixed!
You should add random tests ;-)
Initial solution is still the default one
it may be bad behavior in C, but not in JS. also, golf challenges will never be best practice.
I think the word "having" is more natural in English sentences here so it's the only global intended to be used with
each
for that reason.Doing global references isn't bad practice if you back up the old values of the references and restore them afterward, which doesn't require that much more code in this case.