Returns a subsequence, up to the given maximum length, containing the final elements of the sequence.
- Xcode 10.2+
- Swift Standard Library
The maximum number of elements to return. The value of
maxmust be greater than or equal to zero.
The sequence must be finite. If the maximum length exceeds the number of elements in the sequence, the result contains all the elements in the sequence.
Complexity: O(n), where n is the length of the sequence.