Implemented Swift solutions for Chapter 1