Fix the Right Answer

Published by mdjahid.5533 in

Create a function that takes a string and returns the right answer.

Examples

postfix("2 2 +") ➞ 4

postfix("2 2 /") ➞ 1

postfix("8 4 / 9 * 3 1 * /") ➞ 54

Notes

  • The operators + - * / may be supported.
  • Output always returns an integer.
Watch a quick demo on how Edabit works.