Hi All,

Here is my code, I don't why it fails in this test case:

Input: "ABC",2

Output: "ACB"

Expected: "ACB"

class Solution {

public:

string convert(string s, int numRows) {

```
int len=s.length();
if ((!len)|| (len<=numRows) || numRows <= 1) return s;
int i, j;
string sstr = "";
vector<string> res(numRows);
for (i = 0; i<s.length(); i += (2 * numRows - 2))
{
for (j = 0; j<(2 * numRows - 2); j++)
{
if (j<numRows)
{
res[j] += s[i + j];
}
else
{
res[j - numRows + 1] += s[i + j];
}
}
}
for (i = 0; i<numRows; i++)
{
sstr += res[i];
}
return sstr;
}
```

};