代码# Go packageleetcodefuncconvert(sstring,numRowsint)string{matrix,down,up:=make([][]byte,numRows,numRows),0,numRows-2fori:=0;i!=len(s);{ifdown!=numRows{matrix[down]=append(matrix[down],byte(s[i]))down++i++}elseifup>0{matrix[up]=append(matrix[up],byte(s[i]))up--i++...
https://leetcode.com/problems/zigzag-conversion/ "PAYPALISHIRING" row x 3 P A H N A P L S I I G Y I R */ function ZigZag() {} String.prototype.forEach = function(fn) { for (var i = 0; i < this.length; i++) { fn( this.charAt(i) ); } }; ZigZag.convert = functio...