2dbi
Home/Linear/Evaluate Reverse Polish Notation
LLinear·DSAEngineerTechnical Phone Screen

Evaluate Reverse Polish Notation

Problem

Evaluate an arithmetic expression in Reverse Polish Notation.

Example

["2","1","+","3","*"] -> 9

Constraints

  • Valid expression

Approach

Stack-based evaluation.

added 6 days ago
LeadersAccount