Switch the array places in a loop

You only need one for loop

The trick is to read properly from both arrays

Handle the index correctly

4 Likes