```
class Solution:
# @return a string
def convert(self, s, n):
res = [[] for _ in range(n)]
i = 0
try:
while True:
for r in res:
r.append(s[i])
i += 1
for r in res[-2:0:-1]:
r.append(s[i])
i += 1
except IndexError:
return ''.join(''.join(r) for r in res)
```

Here's a neat one

```
class Solution:
# @return a string
def convert(self, s, n):
idx = itertools.chain(range(n), range(n-2, 0, -1))
res = [[] for _ in range(n)]
for char, i in zip(s, itertools.cycle(idx)):
res[i].append(char)
return ''.join(''.join(r) for r in res)
```