rewrite leetcode zigzag conversion