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.
This comment is hidden because it contains spoiler information about the solution
how does it work? Any documentation that support this assumtion... =)
You are right, and sometimes the shortest code is also the best, depending on language ie Haskell, JS Java C# F#, if it is short because it is coded functionally, or with nice comprehensions in python. not always just depends
To be fair, the never-lasting debate about "what is best practice" happens because
best practice
can be many different things (same toclever
):It's kinda like you're in Oscar and there's only a "Movie of the Year" category. Of course everyone will argue about its all-encompassing nature.
The way to go is, of course, split it into those categories and rank by there. But then it (probably) becomes too complicated for everyone. So I guess we're stuck at now.
There are many dirty tricks to make your code execution faster. Most of which you will never use in production code. People will start upvoting fastest answers as "Best Practice" and people who learn to code will pick up some bad habbits. The only thing that could work is a special category of katas, purposely curated for execution time optimizations with solutions showed from fastest to slowest.
> implying shortest code is never also the fastest code
> implying fastest code = best code
Okay, let's switch to micro-optimizations then?
Duration of execution is a criteria but this shouldn't be THE criteria to determine the best solution. The best solution should be a fine balance between complexity(related to execution time), readability and best practice.
"They said it before, and we'll say it again..."
Add my vote also for a parallel "time to run" score! :D
Possibly this could lead to excessive re-running of solutions to get a lucky fast score. So maybe limit the publicable time-to-rum score just to a user's first successful solution for a given kata, or something like that?
This comment is hidden because it contains spoiler information about the solution
The items in the array may also be null values. Your code uses
if (x)
but you need to have a null check inside the for loop to check if the current value is a null value.Shit. My bad, didn't see the function name - only the description.
This comment is hidden because it contains spoiler information about the solution
what does -> do?
where is row declared in valid9?
can someone explain the code please?
couldn't you avoid the "series whose unique numbers add up to 45 but are not valid sudoku wins. For example 2, 2, 9, 9, 6, 1, 8, 14, 5 or 0, 0, 0, 0, 0, 0, 0, 45. " by doing row.uniq.size == 9
what does -> do?
where is row declared in valid9?
can someone explain the code please?
how exatcly does the number get added to the cache?
Loading more items...