ZigZag conversion latest solution O(1) memory and O(n) time