123456789101112131415 |
- package kata
- import (
- "strings"
- "unicode"
- )
- func Accum(s string) string {
- var sl []string
- for i, r := range s {
- s = string(unicode.ToUpper(r))
- sl = append(sl, s + strings.Repeat(string(unicode.ToLower(r)), i))
- }
- return strings.Join(sl, "-")
- }
|