Ad
  • Default User Avatar

    Short and sweet, but not best practices. I think this is a cute and clever solution for a simple string, but not efficient if the input was 100s or 1000s of characters long. I'd prefer a solution that returned false as soon as a lowercase character was found. In this case this solution is O(n) yet always the worst case, meaning that it always has to reach the last item (ALL characters must be uppercased) before it can determine the boolean value. This is more of a JS like solution than an Elixir solution. Elixir has better "tools" for working with strings.

  • Custom User Avatar
  • Custom User Avatar

    My solution works as expected in Utop, but seems to have the wrong type signature when run on here.

  • Custom User Avatar

    Haha, illustrates that if you code passes tests in's not guarantied to work properly.