Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This is the most memory-efficient solution. I'm kinda frustrated to see a recursive solution as the Best Practices leader.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...