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?
This comment is hidden because it contains spoiler information about the solution
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.This comment is hidden because it contains spoiler information about the solution
But 10 votes and all >=5;-)... The ranking is not always a sign to be able to solve the kata. Sometimes/often it depends on the content too - nobody is able to solve every kata (ok... i'm the exception:-P... hey, it's just fun...)!
The grading is down to warriors who complete the Kata while in beta. I personally think it should be a 4KYU because there is a Kata very simular to this that is at that grading. Sorry
This comment is hidden because it contains spoiler information about the solution
Loading more items...