Check if a String Is an Acronym of Words
Problem
- Return true if s is an acronym of words, and false otherwise.
Go Solution
func isAcronym(words []string, s string) bool {
if len(words) != len(s) {
return false
}
for i := range words {
if words[i][0] != s[i] {
return false
}
}
return true
}