O'Reilly logo

Swift Programming: The Big Nerd Ranch Guide by John Gallagher, Matthew Mathias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 myCities contains all of the cities contained by yourCities. (Hint: This relationship would make myCities a superset of yourCities.)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required