Nagarro interview question

interleaving of array.