Silver Challenge

In this chapter, you used methods like union(_:) and intersect(_:) to create new sets. Sometimes, however, you may not want to create new instances, but would rather modify the existing instances in place. Look through the documentation and find the appropriate methods on the Set type. Rework the examples in the chapter for union(_:) and intersect(_:) to use these methods.

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.