Unit Testing, Property Testing, Elixir Language, Elixirlang, Refactoring.
extra_buckets {extra_buckets, k_buckets} end defp distribute(list, buckets) do Enum.reduce(list, buckets, fn item, buckets -> [current_bucket | rest_of_buckets] = buckets new_bucket = [item | current_bucket] rest_of_buckets ++ [new_bucket] end) end defp distribute_extra({lists, buckets}) do with