Skip to content

Instantly share code, notes, and snippets.

@SuryaPratapK
Created September 12, 2025 08:02
Show Gist options
  • Select an option

  • Save SuryaPratapK/27253a253306c798e83f5a991abc95ae to your computer and use it in GitHub Desktop.

Select an option

Save SuryaPratapK/27253a253306c798e83f5a991abc95ae to your computer and use it in GitHub Desktop.
class Solution {
public:
bool doesAliceWin(string s) {
for(int i=0;i<s.size();++i)
if(s[i]=='a' or s[i]=='e' or s[i]=='i' or s[i]=='o' or s[i]=='u')
return true;
return false;
}
};
/*
// Java
class Solution {
public boolean doesAliceWin(String s) {
for (int i = 0; i < s.length(); ++i) {
char c = s.charAt(i);
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
return true;
}
return false;
}
}
# Python
class Solution:
def doesAliceWin(self, s: str) -> bool:
for ch in s:
if ch in ('a', 'e', 'i', 'o', 'u'):
return True
return False
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment