zigzag conversion

this is totally the original solution from the internet. Cuz this
problem is just a wasting of time