Implement a simpler solution for zig zag conversion without using queues as temporary storage.