[#3227] feat(leetcode): add c# and golang solution
This commit is contained in:
19
problems/3227-vowels-game-in-a-string/go/main.go
Normal file
19
problems/3227-vowels-game-in-a-string/go/main.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// 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
|
||||
}
|
Reference in New Issue
Block a user