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 is a fair assessment. This is really just a "harder" take on the same problem that accounts for some very common edge-cases. Personally, I've seen enough "Code Golf" 30-character solutions to these 7 kyu problems and wanted to provide a different perspective. We're all just here to learn, and I believe this solution provides an opportunity to learn that isn't as common here on CodeWars.
Thank you for the straightforward, intelligible, efficient
O(n)
solution. This is the code I would hope to find in a product or an interview.I agree with many other comments here: easier Katas are flooded with inefficient, upvoted one-line & code golf solutions. There doesn't seem to be enough incentive to write "Best Practice" solutions that are simple, performant, documented, robust, & readable.
Concise solutions aren't inherently bad, but they're currently overrepresented. I believe Codewars should add more incentive for "Best Practice" solutions, including good runtime & memory performance. As far as I'm aware, Codewars is the best code challenge website for learning programming languages & implementing comprehensive unit testing. There are other websites better suited for concise solutions.
This is a necro, but this is exactly how I feel.
I believe CodeWars offers more flexibility & knowledge sharing than other code challenge websites, especially for unit testing & learning new programming langauges. I love how this website encourages users to build comprehensive unit tests, which is typically an undervalued skill.
That said, it's annoying to see the easier Katas flooded with inefficient upvoted one-line & code golf solutions while simple, performant, documented, robust, readable solutions get buried.
I appreciate what
moment.js
offers and the novelty of this solution, but adding several thousand bytes of JavaScript to accomplish this near-trivial task is the opposite of Best Practice. Or maybe I just strongly disagree with the way users distort the meaning of "Best Practice" on this website.This comment is hidden because it contains spoiler information about the solution
This is the most memory-efficient solution. I'm kinda frustrated to see a recursive solution as the Best Practices leader.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This is the "best" O(n) solution I was looking for.
The solutions using
Array.sorted()
are elegant, but Timsort is O(nlog(n)) time complexity.This comment is hidden because it contains spoiler information about the solution
Loading more items...