only one requirement is not passed
package com.codegym.task.task09.task0923;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
/*
Vowels and consonants
*/
public class Solution {
public static char[] vowels = new char[]{'a', 'e', 'i', 'o', 'u'};
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
ArrayList<Character> sn = new ArrayList<Character>();
ArrayList<Character> v = new ArrayList<Character>();
ArrayList<Character> c = new ArrayList<Character>();
for(int i=0;i<s.length();i++){
sn.add(s.charAt(i));
}
for(int j=0;j<sn.size();j++){
if(isVowel(sn.get(j))){
v.add(sn.get(j));
}
else{
c.add(sn.get(j));
}
}
for(char a : v){
System.out.print(a + " ");
}
System.out.println();
for(char b : c){
System.out.print(b + " ");
}
// write your code here
}
// The method checks whether a letter is a vowel
public static boolean isVowel(char c) {
c = Character.toLowerCase(c); // Convert to lowercase
for (char d : vowels) // Look for vowels in the array
{
if (c == d)
return true;
}
return false;
}
}