18th December solution - Advent of Code 2020 - swift
As part of Advent of Code (adventofcode.com) each day there are two programming tasks to be solved. All solutions are listed here.
I am writing the solutions in Swift with the Playground environment in xCode.
Tasks - 18th December 2020
Calculate mathematical expressions from left to right.
Calculate mathematical expressions where addition precedes multiplication operations.
For a more detailed description of the tasks check this out.
The lines
variable is an array of lines in the txt files given to each member by Advent of Code, which is individual for each user.
The solutions are only differ in the calcNoBrackets
functions. Here are the solutions: