1641.cpp (271B)
1 class Solution { 2 public: 3 int countVowelStrings(int n) { 4 int vec[5] = {1, 1, 1, 1, 1}; 5 for (int i = 1; i <= n; i++) { 6 for (int i = 4, sum = 0; i >= 0; i--) 7 vec[i] = sum += vec[i]; 8 } 9 return vec[0]; 10 } 11 };