let myCities = Set(["Atlanta", "Chicago", "Jacksonville", "New York", "San Francisco"])
let yourCities = Set(["Chicago", "San Francisco", "Jacksonville"])
let yourCitiesCheck = yourCities.isSubset(of: myCities)
let myCitiesCheck = myCities.isSubset(of: yourCities)
let checkTuple = (yourCitiesCheck, myCitiesCheck)
switch checkTuple {
case (true, false):
print("I've been to all of the cities you've been to, but the reverse isn't true.")
case (true, true):
print("We've been to exactly the same cities.")
case (false, true):
print("I've not been to all of the cities you've been to, but you've been to all of the cities that I've been to.")
default:
print("We haven't been to any of the same cities")
}
Bronze
var myCities: Set = ["Atlanta", "Chicago", "Jacksonville", "New York", "San Francisco"]
var yourCities: Set = ["Chicago", "San Francisco", "Jacksonville"]
myCities.isStrictSuperset(of: yourCities)