Unit Testing, Property Testing, Elixir Language, Elixirlang, Refactoring.
list |> Enum.count() |> Integer.floor_div(k) Enum.chunk_every(list, chunk_size, chunk_size, []) end end defp into_buckets(list, k, chunk_size) do chunks = Enum.chunk_every(list, chunk_size, chunk_size, []) extra_buckets = Enum.take(chunks, -(Enum.count(chunks) - k)) k_buckets = chunks --