2 added 399 characters in body
source | link

Ruby, 25 bytes

->n,a{[*a.each_slice(n)]}

Try it online!

If we can return enumerators instead of arrays, then it becomes simply:

Ruby, 21 bytes

->n,a{a.each_slice n}

Try it online!

Ruby, 25 bytes

->n,a{[*a.each_slice(n)]}

Try it online!

Ruby, 25 bytes

->n,a{[*a.each_slice(n)]}

Try it online!

If we can return enumerators instead of arrays, then it becomes simply:

Ruby, 21 bytes

->n,a{a.each_slice n}

Try it online!

1
source | link

Ruby, 25 bytes

->n,a{[*a.each_slice(n)]}

Try it online!