20 lines
449 B
Go
20 lines
449 B
Go
// LeetCode 3227: Vowels Game In A String
|
|
// 難度: Medium
|
|
// 日期: 2025-09-12
|
|
|
|
package vowels
|
|
|
|
import "strings"
|
|
|
|
// DoesAliceWin returns true if the string contains any vowel.
|
|
// Game theory reduces to: Alice wins iff there exists at least one vowel.
|
|
func DoesAliceWin(s string) bool {
|
|
const vowels = "aeiou"
|
|
for _, ch := range s {
|
|
if strings.ContainsRune(vowels, ch) {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|