Bronze Challenge

Your expression evaluator currently only supports addition. That is not very useful! Add support for subtraction. You should be able to call evaluate("10 + 5 - 3 - 1") and see it output 11.

Get Swift Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.