Skip to content

Latest commit

 

History

History
63 lines (49 loc) · 1.26 KB

_1641. Count Sorted Vowel Strings.md

File metadata and controls

63 lines (49 loc) · 1.26 KB

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : June 24, 2024

Last updated : July 04, 2024


Related Topics : Math, Dynamic Programming, Combinatorics

Acceptance Rate : 78.69 %


This is just stars and bars lol

n stars, 4 bars
n + 4 choose 4

Solutions

C

int countVowelStrings(int n) {
    return (n + 4) * (n + 3) * (n + 2) * (n + 1) / 24;
}

C++

class Solution {
public:
    int countVowelStrings(int n) {
        return (n + 4) * (n + 3) * (n + 2) * (n + 1) / 24;
    }
};

Java

class Solution {
    public int countVowelStrings(int n) {
        return (n + 4) * (n + 3) * (n + 2) * (n + 1) / 24;
    }
}