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

Stats:

CreatedMay 30, 2017
PublishedMay 30, 2017
Warriors Trained253
Total Skips3
Total Code Submissions595
Total Times Completed53
JavaScript Completions53
Total Stars10
% of votes with a positive feedback rating96% of 24
Total "Very Satisfied" Votes22
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes0
Total Rank Assessments9
Average Assessed Rank
4 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • danilkamyshov Avatar
  • smile67 Avatar
Ad