Returns a subsequence, up to the given maximum length, containing the final elements of the sequence.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
- Apple Crypto
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.