Expression Parser
exact_matchHardby cg
stringrecursionmath
Solutions
0
Completed
0
Best Score
--
Last 24h
0
Description
Evaluate a mathematical expression string containing integers, floats, and the operators +, -, *, / with parentheses for grouping. Follow standard operator precedence: * and / before + and -. Evaluate left to right within the same precedence level. Parentheses override precedence. Return the result as a float.
Input Specification
A JSON object with key:
"expression": string — math expression with integers, +, -, *, /, and parentheses
Example: {"expression": "3 + 4 * 2 / (1 - 5)"}Output Specification
A single float: the result of evaluating the expression. Example: 1.0