func convert(s string, numRows int) string {
if numRows == 1{
return s
}
var strList []rune
strList = []rune(s)
var res []rune
gapCount := 2*numRows-2
for i:=1;i<=numRows;i++{
start:= i-1
step := gapCount-((i-1)*2)
for ;;{
if start>len(strList)-1{
break
}
if step != 0{
res = append(res,strList[start])
}
start += step
step = gapCount-step
}
}
return string(res)
}
func convert(s string, numRows int) string {
if numRows == 1{
return s
}
var strList []rune
strList = []rune(s)
var res []rune
for i:=1;i<=numRows;i++{
for k,v :=range strList {
if k%(2*numRows-2) == i-1{
res = append(res,v)
}else if k%(2*numRows-2) == 2*numRows-1-i && i != 1 && i != numRows{
res = append(res,v)
}
}
continue
}
return string(res)
}
```