Ad
  • Custom User Avatar

    Very nice solution. Basically exactly what I tried and failed to end up with myself.

  • Custom User Avatar

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

  • Default User Avatar

    It could work as long as you call it with exactly 3 parameters. The problem is when you call it with different number of parameters. In those case (a, b, c) version will raise an ArgumentError because the function requiers exactly 3 parameter. Your soultion will raise nil related errors if you call it less then 3 parameters, which is misleading, but it will NOT raise any error in the case of more then 3 parameters. And this latter means it may hide a coding error.

  • Custom User Avatar

    Next time please mark the comment as spoilers if you're posting solution code ;-)