Skip to content

Instantly share code, notes, and snippets.

@ankur-anand
Created May 15, 2015 11:53
Show Gist options
  • Save ankur-anand/7f1f237fafe0d01e7c2d to your computer and use it in GitHub Desktop.
Save ankur-anand/7f1f237fafe0d01e7c2d to your computer and use it in GitHub Desktop.
import java.util.ArrayList;
import java.util.Scanner;
class TestClass {
public static void main(String args[] ) throws Exception {
Scanner keyboard=new Scanner(System.in);
int t=keyboard.nextInt();
keyboard.nextLine();
ArrayList<String> vowelList= new ArrayList<>();
vowelList.add("a");
vowelList.add("e");
vowelList.add("i");
vowelList.add("o");
vowelList.add("u");
while(t!=0){
String s= keyboard.nextLine();
int len=s.length();
String sub=s.substring(4,len-4);
String[] splitted=sub.split("\\B");
ArrayList<String> splt= new ArrayList<>();
for(String x:splitted){
splt.add(x);
}
splt.removeAll(vowelList);
int size=splt.size();
System.out.println(size+4+"/"+len);
t--;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment