From ae4d1691017d6ccc8f0bc4ef5348ba6fd4983c46 Mon Sep 17 00:00:00 2001 From: neetcode-gh <77742485+neetcode-gh@users.noreply.github.com> Date: Sat, 18 Feb 2023 13:33:09 -0800 Subject: [PATCH] Delete 1220-Count-Vowels-Permutation.py --- python/1220-Count-Vowels-Permutation.py | 39 ------------------------- 1 file changed, 39 deletions(-) delete mode 100644 python/1220-Count-Vowels-Permutation.py diff --git a/python/1220-Count-Vowels-Permutation.py b/python/1220-Count-Vowels-Permutation.py deleted file mode 100644 index 845da7a03..000000000 --- a/python/1220-Count-Vowels-Permutation.py +++ /dev/null @@ -1,39 +0,0 @@ -class Solution: - Memo = {} - def countVowelPermutation(self, n, c = '') -> int: - if (c, n) in self.Memo: - return self.Memo[(c, n)] - if n == 1: - if c == 'a': - return 1 - if c == 'e': - return 2 - if c == 'i': - return 4 - if c == 'o': - return 2 - if c == 'u': - return 1 - if c == '': - return 5 - else: - if c == 'a': - self.Memo[('a', n)] = self.countVowelPermutation(n - 1, 'e') - return self.Memo[('a', n)] - if c == 'e': - self.Memo[('e', n)] = self.countVowelPermutation(n - 1, 'a') + self.countVowelPermutation(n - 1, 'i') - return self.Memo[('e', n)] - if c == 'i': - self.Memo[('i', n)] = self.countVowelPermutation(n - 1, 'a') + self.countVowelPermutation(n - 1, 'e') + self.countVowelPermutation(n - 1, 'o') + self.countVowelPermutation(n - 1, 'u') - return self.Memo[('i', n)] - if c == 'o': - self.Memo[('o', n)] = self.countVowelPermutation(n - 1, 'i') + self.countVowelPermutation(n - 1, 'u') - return self.Memo[('o', n)] - if c == 'u': - self.Memo[('u', n)] = self.countVowelPermutation(n - 1, 'a') - return self.Memo[('u', n)] - if c == '': - Tot = 0 - for i in ['a', 'e', 'i', 'o', 'u']: - Tot = Tot + self.countVowelPermutation(n - 1, i); - return Tot % 1000000007