k.go 148 B

12345678910
  1. package kata
  2. func WordsToMarks(s string) int {
  3. sum := 0
  4. var start rune = 'a' - 1
  5. for _, r := range s {
  6. sum += int(r - start)
  7. }
  8. return sum
  9. }