class Solution {
public:
string convert(string s, int nRows) {
if (s.empty()  nRows <= 0)
{
return "";
}
if (nRows == 1)
{
return s;
}
string zipS = "";
int len = s.length();
int loc = 0;
for (int k = 0; k < nRows; k++)
{
if (k == 0  k == nRows  1)
{
zipS += s[k];
loc = k;
while(loc+2*nRows2 < len)
{
loc += 2*nRows2;
zipS += s[loc];
}
}
else
{
int j = 1;
zipS += s[k];
loc = k;
while(((j%2==1) && (loc+2*(nRowsk1)) < len) (((j%2) == 0) && (loc+2*k) < len))
{
if (j%2 == 1)
{
zipS += s[loc+2*(nRowsk1)];
loc += 2*(nRowsk1);
}
else
{
zipS += s[loc+2*k];
loc += 2*k;
}
j++;
}
}
}
return zipS;
}
};
I don't konw what it mean.it say "wrong answer, input["A",2],output"A",expected "A""


Checkout https://oj.leetcode.com/faq/ and pay attention to Why is my output wrong answer even though it looks identical to expected?