Splits an input array into individual chunks.