Bronze Challenge

Consider the following code that models the cities two people have visited as sets.

let myCities = Set(["Atlanta", "Chicago",
                    "Jacksonville", "New York", "San Francisco"])
let yourCities = Set(["Chicago", "San Francisco", "Jacksonville"])

Find a method on Set that returns a Bool indicating whether or not myCities contains all of the cities contained by yourCities. (Hint: this relationship would make myCities a superset of yourCities.)

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.