aboutsummaryrefslogtreecommitdiffstats
path: root/1641/main.cpp
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-05-11 14:48:39 +0000
committerterminaldweller <thabogre@gmail.com>2022-05-11 14:48:39 +0000
commit56273bd3e9fbfa18f79bc80d9afde7f6400519d8 (patch)
tree8b4827e8f56205d8696726ae3bce1a62f5183779 /1641/main.cpp
parentupdate (diff)
downloadleetcode-56273bd3e9fbfa18f79bc80d9afde7f6400519d8.tar.gz
leetcode-56273bd3e9fbfa18f79bc80d9afde7f6400519d8.zip
update
Diffstat (limited to '')
-rw-r--r--1641/main.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/1641/main.cpp b/1641/main.cpp
new file mode 100644
index 0000000..4fb4efe
--- /dev/null
+++ b/1641/main.cpp
@@ -0,0 +1,23 @@
+#include "header.hpp"
+
+class Solution {
+public:
+ static int countVowelStrings(int n) {
+ std::vector<unsigned int> count = {1, 1, 1, 1, 1};
+ while (--n > 0) {
+ count[1] += count[0];
+ count[2] += count[1];
+ count[3] += count[2];
+ count[4] += count[3];
+ }
+
+ return count[0] + count[1] + count[2] + count[3] + count[4];
+ }
+};
+
+int main(int argc, char **argv) {
+ std::cout << Solution::countVowelStrings(1) << std::endl;
+ std::cout << Solution::countVowelStrings(2) << std::endl;
+ std::cout << Solution::countVowelStrings(33) << std::endl;
+ return 0;
+}