Ad
  • Custom User Avatar

    The old //, never fail.

  • Custom User Avatar

    Bravo! Also, you declare a variable in Elixir much like in other languages, something = "whatever", except as you've noticed sometimes declaring a variable is very optional, and also there is a caveat: the = is also a pattern-matching operation, more akin to a mathematical = sign, which can be very fun to use, or very ""fun"" if you don't know what you're doing. e.g.
    x = 1
    1 = x # true
    2 = x # false
    Note that if we want to pattern-match two variables, we will have to use ^ on the left-hand side to "pin" it or it will be rebound to the right-hand side.

  • Custom User Avatar

    Test.assertEquals should be used in the sample test cases as well, please, not just the solution evaluation.