Slice to Map
Lesson 14 of 24 in Coddy's Golang Challenges - Level 1 course.
Challenge
EasyWrite a function that takes a slice and returns a map where the key is the string and its length as a value.
Example:
Input: []string{"Coddy", "LearnGolang", "LearnPython", "Challenges"}
Output: map[Challenges:10 Coddy:5 LearnGolang:11 LearnPython:11]
Try it yourself
func slicetoMap() {
}All lessons in Golang Challenges - Level 1
1Introduction
Introduction3Play with Slices & Arrays
Longest StringDouble Even NumbersSum Average Minimum and MaxSumEven & Odd NumbersSlice to Map Non Repeated Indices