Skip to content

Commit

Permalink
Merge pull request neetcode-gh#889 from Vitali-Matteo/patch-3
Browse files Browse the repository at this point in the history
Create 1641-Count-Sorted-Vowel-Strings.cpp
  • Loading branch information
Ahmad-A0 authored Aug 23, 2022
2 parents eb44643 + 68ac6ec commit d755dad
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions python/1641-Count-Sorted-Vowel-Strings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class Solution{
public:
int countVowelStrings(int n){
int An, En, In, On, Un;
int An1, En1, On1, In1, Un1;
int i;
An1 = En1 = In1 = On1 = Un1 = 1;
i = 1;
while(i < n){
An = An1 + En1 + On1 + In1 + Un1;
En = En1 + On1 + In1 + Un1;
In = In1 + On1 + Un1;
On = On1 + Un1;
Un = Un1;
An1 = An;
En1 = En;
On1 = On;
In1 = In;
i++;
}
return An1 + En1 + In1 + On1 + Un1;
}
};

0 comments on commit d755dad

Please sign in to comment.