Retired
Calculate character group variations (retired)
14Nadika
Description:
Calculate character group variations
You are given two numbers:
- The first number represents the amount of characters for the first group.
- The second number represents the amount of characters for the second group.
Each group contains identical characters within the group, but the characters in the two groups are distinct from each other. These two input numbers can be any positive integers or zero.
Your task is to determine the number of distinct variations that can be formed by arranging all the characters from both groups together. You need to account for all unique permutations of the combined characters.
Examples:
countVariations(2, 3) => 10.
Explanation: You have two 'A's and three 'B's. The total number of distinct arrangements of these characters is 10.
Example arrangements:
AABBB ABABB ABBAB ABBBA BAABB BABAB BBAAB BBABA BBBAA BAAAB Output: 10
Good luck. You can do it codeninja!🥷
Mathematics
Fundamentals
Combinatorics
Similar Kata:
Stats:
Created | Jan 24, 2025 |
Warriors Trained | 15 |
Total Skips | 0 |
Total Code Submissions | 42 |
Total Times Completed | 14 |
JavaScript Completions | 14 |
Total Stars | 1 |
% of votes with a positive feedback rating | 50% of 8 |
Total "Very Satisfied" Votes | 1 |
Total "Somewhat Satisfied" Votes | 6 |
Total "Not Satisfied" Votes | 1 |
Total Rank Assessments | 8 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |