Junior — Senior
What result will be displayed in example №22
livecode
Task condition
In this example, we create a set from the given numbers, where duplicates are automatically removed, and then sum all the unique elements of the set. What will be printed?
let sumResult = Set(arrayLiteral: 1, 2, 3, 3, 2, 1).reduce(0, +)
print(sumResult)