-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvenVow.java
More file actions
44 lines (42 loc) · 1.11 KB
/
EvenVow.java
File metadata and controls
44 lines (42 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
public class EvenVow {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
int l = 0;
int r = s.length() - 1;
ArrayList<Character> ls = new ArrayList<>();
HashSet<Character> hs = new HashSet<>();
hs.add('a');
hs.add('e');
hs.add('i');
hs.add('o');
hs.add('u');
hs.add('A');
hs.add('E');
hs.add('I');
hs.add('O');
hs.add('U');
for(char ch : s.toCharArray()){
if(hs.contains(s.charAt(ch))){
ls.add(s.charAt(ch));
}
}
int idx = ls.size();
boolean isEven = false;
while(l <= s.length()-1 && idx > 0){
for(r = s.length() -1; r >= 0; r--){
}
}
if(idx == 0){
isEven = true;
System.out.println( isEven);
sc.close();
return;
}
System.out.println(isEven);
sc.close();
}
}