Ad
  • Custom User Avatar

    To be fair, most real world, practical problems have more complex and less elegant solution requirements. This is a simple, elegant problem, and I figured it called for a simple, elegant solution. Plus, I disagree that this is less readable than the 4-5 line for loop/if block solutions- There's hardly any control flow to speak of, so it requires less effort to track how the algorithm works. It's just two simple data manipulation operations.

  • Custom User Avatar

    Yeah I think it tends to be a combination of some users coming from more of a immutable/functional language mindset and applying that paradigm to languages like Ruby. Also the highest voted solutions might to be voted on more because someone learned something from it, not that its the best solution for the job.

  • Default User Avatar

    CodeWars voters seem to heavily prefer clever one-liners over readability or performance. There might be a way to influence that in a better direction ("better" in the "actually being a developer" sense)