```
package string
import "strconv"
func countAndSay(n int) string {
if n == 0 {
return ""
}
res := "1"
for ; n > 1; n-- {
cur := ""
for i := 0; i < len(res); i++ {
count := 1
for i+1 < len(res) && res[i] == res[i+1] {
count++
i++
}
cur += strconv.Itoa(count) + string(res[i])
}
res = cur
}
return res
}
```