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.
Local variable 'highest_word' might be referenced before assignment
I didn't know that JS had the "isIteger" method! You changed my future projects so much with that, thank you!
The task stated that you're given a valid number and examples also shown that you are in fact is getting only a Number. By converting it to a String in your code you introduced an issue about different separators and now you're solving it :)
The performant comment makes a lot of sense. Can we spell out what the other assumptions are so I can get a better understanding?
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.
It's bad. The programmer assumes things which you should never do. This solution is vastly less performant because of that. It should only be transfored to this when the actual implementation calls for this change, never sooner.
Thanks for adding the code comments. Very helpful when trying to figure out the best practices for this particular solution!
So this is what developers call 'production code' ...
Thank you for this lesson. I mean that.
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
Loading more items...