Pergunta de entrevista da empresa Apple

Take the following array and split it into 3 groups, with each group equaling 4 Array = [0, 2, 0, 4, 2, 4]