What does this print?
let nums = [4, 1, 3, 1]
let out = nums
.filter { $0 > 1 }
.sorted()
print(out)
Try it in the online Swift Playground →
[spoiler title="Solution"]
Answer:
[3, 4]
Explanation:
filter removes 1s leaving [4, 3], then sorted orders the remaining values ascending.
[/spoiler]