Problem Statement
What benefit does a `lazy` collection or sequence provide when using higher-order functions in Swift?
Explanation
In Swift you can mark a collection as `lazy` so that when you chain higher-order functions like `map`, `filter`, `reduce`, the work is deferred and fused. This can reduce overhead and improve performance when you only need part of the result.
Practice Sets
This question appears in the following practice sets: