18 lines
388 B
Go
18 lines
388 B
Go
|
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
|
||
|
}
|