@@ -0,0 +1,863 @@
+public class Solution %7B%0A    public String convert(String s, int numRows) %7B%0A        if( numRows == 1)%7B%0A            return s;%0A        %7D%0A        StringBuilder sb = new StringBuilder();%0A        int magic = numRows *2 -2;                  //here is the core part%0A        int initialDistance = magic;%0A        for(int i=0; i%3C numRows; i++)%7B%0A            fill(sb, i, initialDistance, magic, s);%0A            initialDistance = initialDistance -2;%0A        %7D%0A        return sb.toString();%0A    %7D%0A    %0A    public void fill(StringBuilder sb, int start, int initialDistance, int magic, String s)%7B%0A        while(start%3Cs.length())%7B%0A            if(initialDistance == 0)%7B%0A                initialDistance = magic;%0A            %7D%0A            sb.append(s.charAt(start));%0A            start = start + initialDistance;%0A            initialDistance = magic - initialDistance;%0A        %7D%0A    %7D%0A%7D

The solution for 6