exercism/go/etl/etl.go

18 lines
388 B
Go
Raw Normal View History

2016-08-13 23:20:14 +00:00
package etl
import "strings"
// Transform takes the legacy data structure
// and converts it into the new and improved
// data structure oh man this new system will
// make us so rich you guys.
func Transform(input map[int][]string) map[string]int {
ret := make(map[string]int)
for k, v := range input {
for _, let := range v {
ret[strings.ToLower(let)] = k
}
}
return ret
}