Ad
  • Default User Avatar

    I know this is an old comment, so this is for whoever sees this.
    Ruby seems like a bit of an outlier, as it's naturally less verbose
    than most other languages. At least in my experience, once you become
    familiar with all of the most commonly used ruby methods, one liners
    like this can actually be just as understandable (if not more so) as
    more verbose code.

  • Custom User Avatar

    Added sample tests and updated description.

  • Custom User Avatar

    Also, just like StackOverflow, fastest gun in the west effect applies, and it's mostly everyone upvoting on the same early solution that was top because it was top and hence most visible.

    Also, voting system is popularity vote so it's not necessarily a good indicator at all. Do you want to listen to 1000 novices, or 3 very experienced coders explaining the same topic? ;-)

  • Custom User Avatar

    Best Practices or Clever depends upon who you talk to, and whether they had their coffee yet, or which day of the week it is. for example, one might insist that Best Practices applies to this solution, while another might remind us how code golf is not always the best solution. also, Best Practices seems more presumptive than Clever, since Best Practices conforms to some standard, while Clever is basically like saying cool bro

    since a vote basically means thumbs up, choose either one

  • Custom User Avatar

    Clean and readable solution

  • Custom User Avatar

    I believe it is to do with the readibility. It's almost English !!!

  • Default User Avatar

    Sorry if this sounds stupid, but: What's the exploit in your solution? I used a similar solution and thought it was the intended one.

  • Default User Avatar

    I was mildly confused by the usage of "nd" as well. May I suggest using "stop", "final", "terminal", "limit", "endpoint" or something similar?

  • Default User Avatar

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

  • Default User Avatar

    At the risk of sounding stupid: What exactly is your reasoning behind that, @Absurdated?

  • Custom User Avatar

    This practice is tipical for polymorphic functions. Usualy polymorphic functions differ argument tuple but this fucntion is polymorphic because has two diffirent definitions for n > 0 and n < 0.

  • Custom User Avatar

    When [[1,2],[3,4],[5,6]] passed, it should return nil, but solution witch returns 4 passes all tests.

  • Custom User Avatar

    Yes, I think you're right. My solution is bad.

  • Default User Avatar

    Sounds as if your solution might be getting stuck in an infinite loop.

  • Default User Avatar

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

  • Loading more items...