Implementing a binary search in elixir