mirror of
https://git.wolves.top/wolves/leetcode.git
synced 2025-11-04 17:26:32 +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
|
|
}
|