mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-01-13 02:38:37 +08:00
14 lines
235 B
Go
14 lines
235 B
Go
package main
|
|
|
|
import "strings"
|
|
|
|
func findWordsContaining(words []string, x byte) []int {
|
|
var result []int
|
|
for i, word := range words {
|
|
if strings.Index(word, string(x)) != -1 {
|
|
result = append(result, i)
|
|
}
|
|
}
|
|
return result
|
|
}
|