Sorry my English is not so well. I'm a noob Chinese.
So maybe this article is hard to understand. Forgive me plz.
I think a string convert to ZigZag pattern is like .... eh.. how to describe...
Like this, string is 'abcdef' and numRows is 4
First, ZigZag pattern's first col is a b c d from top to bottom like this:
and then the second col is e f from bottom to top.
But when numRows is 2
The answer is acebdf... it means the pattern is
a c e
b d f
But i think it should be
a d e
b c f
So who can tell me why?
(F**k i think i write a piece of shit... Sorry)
Your writing is not terrible. The way I understand it is the zig zag pattern does not look like
\ /\ \/ \
It looks more like
| /| /
Also, I think what you are describing with the
a d e
b c f
is more like a square wave pattern, which does not fit in this instance.
Hope this helps!
First, thank you very much.
And i think i get what you say.
When numRows is 2,
the pattern is only
the part of / is not in pattern, right?
So it is
When numRows > 2, then the pattern is
| / |
| / | like this.
I think i have understood it.
Thank you and Thank you very much!