
Shortest word
write a function shortestWord(words []string) int
that, given a slice of strings, return the length of the shortest string bytewise.
If there are more than one such strings, it returns the last one.
To test the function you can use the main
below:
func main() {
const N = 10
:= make([]string, N)
words
for i := 0; i < N; i++ {
.Scan(&words[i])
fmt}
.Println(shortestWord(words))
fmt}