@@ -0,0 +1,906 @@
+package leetcode;%0A%0A/**%0A * https://oj.leetcode.com/problems/zigzag-conversion/%0A */%0Apublic class Problem6 %7B%0A    public String convert(String s, int nRows) %7B%0A        if (nRows %3C= 1) %7B%0A            return s;%0A        %7D%0A        String result = %22%22;%0A        char%5B%5D chars = s.toCharArray();%0A        int step1 = nRows + nRows - 2;%0A        for (int i = 0; i %3C nRows; i++) %7B%0A            int next1 = i;%0A            int next2 = i;%0A            int step2 = step1 - (i * 2);%0A            while (next1 %3C chars.length) %7B%0A                result += chars%5Bnext1%5D;%0A                next1 += step1;%0A                %0A                if (step2 != step1 && step2 %3E 0) %7B%0A                    next2 += step2;%0A                    if (next2 %3C chars.length) %7B%0A                        result += chars%5Bnext2%5D;%0A                        next2 = next1;%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A        return result;%0A    %7D%0A%7D%0A

Solve problem 6