-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTRNM.txt
More file actions
31 lines (27 loc) · 744 Bytes
/
STRNM.txt
File metadata and controls
31 lines (27 loc) · 744 Bytes
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
//https://www.codechef.com/problems/STRNM
//author : Pravash Ranjan Nayak
import java.util.*;
class Solution
{
public static void main(String args[])
{
Scanner ob=new Scanner(System.in);
int m=(int)1e9+7;
int T=ob.nextInt();
ob.nextLine();
while(T-->0)
{
String s=ob.nextLine();
long sum=0;
int n=s.length();long p=1;
for(int i=n-1;i>-1;i--)
{
char c=s.charAt(i);
if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u')
sum=(sum%m+p%m)%m;
p=(p%m*2%m)%m;
}
System.out.println(sum);
}
}
}