public String convert(String s, int nRows) {
    	if (nRows == 1)
    		return s;
    	StringBuilder sb = new StringBuilder();
    	int len = s.length();
    	int partition = 2 * nRows - 2; 
    	for (int i = 0; i < nRows; i++)
    		for (int j = 0; j < len; j++)
    		{
    			if (j % partition == i || j % partition == partition - i)
    				sb.append(s.charAt(j));
    		}
    	return sb.toString();
    }