Microsoft Interview Question

Given a string with plus, minus, parenthesis, numbers, evaluate the expression.

Interview Answer

Anonymous

Dec 20, 2016

JavaScript answer is easy: function evaluateString(str) { let func = Function(`return ${str};`); return func(); }