Given an array [a1, a2, …, aN, b1, b2, …, bN, c1, c2, …, cN] convert it to [a1, b1, c1, a2, b2, c2, …, aN, bN, cN] in-place using constant extra space
At first this question felt a little confusing so lets clear a few things.
– There will only be a, b and c
– The size of the array is going to be
– The problem needs to be solved without creating an extra array so the modifications need to be made in the same array