+ 3
Why is the answer 2?
What is the output of the following code? let a: Set = ["A", "B", "C"] let b: Set = ["B", "D", "E", "A"] print(b.subtract(a).count)
1 Resposta
+ 19
b.subtract(a) returns the elements that are contained in b, but not in a, which are the elements D and E.
count returns the number of elements that are returned from the subtract method.