Skip to content

Instantly share code, notes, and snippets.

@qunabu
Created November 26, 2020 10:33
Show Gist options
  • Save qunabu/10bad20636dccd856737ef9312c93050 to your computer and use it in GitHub Desktop.
Save qunabu/10bad20636dccd856737ef9312c93050 to your computer and use it in GitHub Desktop.
// Reverse Polish Notation, add 3 and 4, one would write 3 4 + rather than 3 + 4
it("should properly calculate a RPN expression", () => {
const result = RPN("5 1 2 + 4 * - 10 /");
expect(result).toBe(-0.7);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment