Input: "ABCD", 2
A C D
even you consider this:
The answer is never ACBD I think
For ABCD, 2, the zig-zag format should be like (lines are just for easily understanding):
| / |
So the answer is ACBD
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.