6. ZigZag Conversion

class Solution {
    public String convert(String s, int numRows) {
        int len = s.length();
        if(numRows<2||len==0){
            return s;
        }
        int d = 2*numRows-2;
        String res = "";
        for(int row = 0;row=len)
                        break;
                    res+=s.charAt(i);
                    i+=d-2*row;
                }
            }
        }
        return res;
    }
}

你可能感兴趣的:(6. ZigZag Conversion)