5 kyu
No Return #3: Solve the Equation
Description:
Implement a function that is capable of solving simplest linear equations for x
, for example:
3+5=x-2
=> x = 10,
10.4 + 5 = x + 4.67
=> x = 10.73.
Some additional whitespaces might be passed as input:
' 3 + 8 = -7 - x'
'- 434.42 + 44.3 - 90.4 + x = 0'
but the input will always be VALID
(i.e. no repeated operations 3 + 5 - - 7 = x
or 10-x = 5 ++3
and x
will always be present).
There will be ~80 of random tests (don't worry about round-off errors, solutions will be compared against some ∆x and will generally not exceed 8 decimal digits after the point).
Oh, and the most important bit: you are NOT
allowed to use the return
reserved keyword.
Mathematics
Algorithms
Similar Kata:
Stats:
Created | May 30, 2017 |
Published | May 30, 2017 |
Warriors Trained | 253 |
Total Skips | 3 |
Total Code Submissions | 595 |
Total Times Completed | 53 |
JavaScript Completions | 53 |
Total Stars | 10 |
% of votes with a positive feedback rating | 96% of 24 |
Total "Very Satisfied" Votes | 22 |
Total "Somewhat Satisfied" Votes | 2 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 9 |
Average Assessed Rank | 4 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 6 kyu |