The output is correct . But i'm getting verification error . Please help to rectify . Thanks .
package com.codegym.task.task09.task0923;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
/*
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 {
// write your code here
ArrayList<Character> vowels = new ArrayList<Character>();
ArrayList<Character> notavowel = new ArrayList<Character>();
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
String s = buffer.readLine();
String[] name = s.split("\\s+");
for (String nname : name )
{
for (int j = 0 ; j < nname.length() ; j++)
{
char c = nname.charAt(j);
if (isVowel(c))
{
vowels.add(c);
}
else
{
notavowel.add(c);
}
}
}
for (char vow : vowels)
System.out.print(vow + "\t");
System.out.println();
for (char nvow : notavowel)
System.out.print(nvow + "\t");
}
// 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;
}
}