Skip to content

Commit 30303e8

Browse files
👾
1 parent c0c133a commit 30303e8

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

Beginner/CV (CV)/cv.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
int t, N, c=0;
6+
string S;
7+
cin>>t;
8+
9+
while (t--) {
10+
cin>>N;
11+
cin>>S;
12+
for(int i=1;i<N;i++){
13+
if(S[i]=='a' || S[i]=='e' || S[i]=='i'|| S[i]=='o'||S[i]=='u'){
14+
if(S[i-1]!='a' && S[i-1]!='e' && S[i-1]!='i' && S[i-1]!='o' && S[i-1]!='u'){
15+
c++;
16+
}
17+
}
18+
}
19+
cout<<c<<endl;
20+
}
21+
return 0;
22+
}

Beginner/CV (CV)/cv.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
t = int(input())
2+
V = ['a', 'e', 'i', 'o', 'u']
3+
4+
while t:
5+
N = int(input())
6+
S = input()
7+
c = 0
8+
9+
for i in range((len(S)-1)):
10+
if (S[i] not in V) and (S[i+1] in V):
11+
c = c+1
12+
13+
print(c)
14+
15+
t = t-1

Beginner/CV (CV)/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
### https://www.codechef.com/problems/CV

0 commit comments

Comments
 (0)