Retired

Calculate character group variations (retired)

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:

CreatedJan 24, 2025
Warriors Trained15
Total Skips0
Total Code Submissions42
Total Times Completed14
JavaScript Completions14
Total Stars1
% of votes with a positive feedback rating50% of 8
Total "Very Satisfied" Votes1
Total "Somewhat Satisfied" Votes6
Total "Not Satisfied" Votes1
Total Rank Assessments8
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Nadika Avatar
Ad