leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

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 };