Reverse Polish Notation

Published by Matt in

Create a function to emulate a Reverse Polish Notation calculator.

Examples

rpn([1, 2, "*", 4,5, "*" , "+"]) ➞ 22

rpn([1,1,"+"]) ➞ 2

rpn([16,16, "/" ]) ➞ 1

Notes

Learn more about Reverse Polish Notation in Resources.

Watch a quick demo on how Edabit works.