We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11ef8fa commit c2362d9Copy full SHA for c2362d9
scripts/algorithms/C/Count Sorted Vowel Strings/Count Sorted Vowel Strings.py
@@ -1,12 +1,13 @@
1
+// Runtime: 28 ms (Top 98.15%) | Memory: 13.9 MB (Top 68.10%)
2
class Solution:
- def countVowelStrings(self, n: int) -> int:
3
+ def countVowelStrings(self, n: int) -> int:
4
dp = [[0] * 6 for _ in range(n+1)]
5
for i in range(1, 6):
6
dp[1][i] = i
-
7
+
8
for i in range(2, n+1):
9
dp[i][1]=1
10
for j in range(2, 6):
11
dp[i][j] = dp[i][j-1] + dp[i-1][j]
12
- return dp[n][5]
13
+ return dp[n][5]
0 commit comments