HackerRank – Zig Zag Sequence solution
In this article, I’ll explain the Zig Zag Sequence algorithm problem on HackerRank. Problem statement: You’re given an integer array with an odd number of elements (ex: [5, 2, 3, 1, 4]). You need to re-arrange the elements so they’re in a zig zag sequence, which means: Here’s a diagram to help you visualize what … Read more