Draft
Expanding Binomial Expressions (simple)
Description:
In this kata, you'll be given a function called calculate, which takes in a term index and a binomial expression string, and returns the corresponding term in the expanded form of the expression. The function uses the binomial coefficient formula to calculate the coefficients of the expanded terms.
The binomial expression string will have the following format:
(a + b)^n
where a and b are integers and n is a non-negative integer. The termIndex will be a positive integer representing the position of the term in the expanded form of the expression (1-indexed).
Your task is to refactor the provided code if necessary and create test cases to validate the functionality of the calculate function.
Algorithms
Algebra
Similar Kata:
Stats:
Created | May 6, 2023 |
Warriors Trained | 6 |
Total Skips | 0 |
Total Code Submissions | 16 |
Total Times Completed | 3 |
JavaScript Completions | 3 |
Total Stars | 0 |
% of votes with a positive feedback rating | 0% of 2 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 0 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 2 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 7 kyu |