@@ -0,0 +1,766 @@
+package algorithm.string;%0A%0A/**%0A * @author Allen on 2017/1/7.%0A */%0Apublic class ZigZagConversion %7B%0A    public String convert(String s, int numRows) %7B%0A        if(numRows %3C= 1) %7B%0A            return s;%0A        %7D%0A%0A        StringBuilder sb = new StringBuilder();%0A        char%5B%5D chars = s.toCharArray();%0A        // the size of a cycle(period)%0A        int cycle = 2 * numRows - 2;%0A        for (int i = 0; i %3C numRows; i++) %7B%0A            for (int j = i; j %3C s.length(); j = j + cycle) %7B%0A                sb.append(chars%5Bj%5D);%0A                int secondJ = (j -i) + cycle - i;%0A                if(i != 0 && i != numRows - 1 && secondJ %3C chars.length) %7B%0A                    sb.append(chars%5BsecondJ%5D);%0A                %7D%0A            %7D%0A        %7D%0A        return sb.toString();%0A    %7D%0A%7D%0A

add new Zigzag solution