Retired
Is the operation associative? (retired)
Description:
In mathematics, a binary operation over the integers, denoted by an operator # and having two arguments, is associative if and only if:
a # (b # c) = (a # b) # c for all values of a, b, and c.
Your task is to determine if the provided operator is mathematically associative or not and return true or false respectively.
All inputs will be valid and selected from built-in operators used for arithmetic and passed in as strings.
Example:
'-' is not an associative operator since for all values of a, b, and c it is not true that: a - (b - c) = (a - b) - c.
Taking a, b, c = 7 we can see that subtraction is not an associative operation:
7 - (7 - 7) != (7 - 7) - 7
7 - 0 != 0 - 7
7 != -7
Input: '-' => false
Mathematics
Similar Kata:
Stats:
Created | Oct 11, 2022 |
Warriors Trained | 16 |
Total Skips | 0 |
Total Code Submissions | 44 |
Total Times Completed | 15 |
JavaScript Completions | 15 |
Total Stars | 0 |
% of votes with a positive feedback rating | 56% of 9 |
Total "Very Satisfied" Votes | 4 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 10 |
Average Assessed Rank | 8 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |