Nagarro Interview Question

interleaving of array.