Off By One Product Expressions
Description:
In this kata, you will be given an incorrect mathematical expression consisting of products and will have to correct it using your implementation of fix_expression
.
The expressions themselves will have one error, where one number provided is off by one from its intended value (7 would be given to you as 6 or 8). This will invalidate an otherwise correct expression, and you are to find which number is wrong, and in what direction it is incorrect.
For example, if your function is given '3*2=5'
, it should correct the right side of the expression to be 6, validating the expression and returning '3\*2=6'
. Each test case will have only one number off by one, and only one valid solution. Both sides may be expressed as products ('4*3=6*1'
) and either side may contain the error.
Similar Kata:
Stats:
Created | Mar 2, 2018 |
Warriors Trained | 9 |
Total Skips | 0 |
Total Code Submissions | 0 |
Total Times Completed | 1 |
Python Completions | 1 |
Total Stars | 0 |
% of votes with a positive feedback rating | 0% of 0 |
Total "Very Satisfied" Votes | 0 |
Total "Somewhat Satisfied" Votes | 0 |
Total "Not Satisfied" Votes | 0 |