[AMAZON]Arrange Array elements

  • In given array of elements like [a1,a2,a3,..an,b1,b2,b3,..bn,c1,c2,c3,...cn] Write a program to merge them like [a1,b1,c1,a2,b2,c2,...an,bn,cn].

    PS: Do it without using extra memory

    Sample Testcases:
    Input #00:
    {1,2,3,4,5,6,7,8,9,10,11,12}
    Output #00:
    {1,5,9,2,6,10,3,7,11,4,8,12}
    Explanation:
    Here as you can notice, the array is of the form
    {a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4}

Comments

Popular posts from this blog