Returns the distance between two indices.
SDK
- Xcode 7.1+
Framework
- Swift Standard Library
Declaration
Parameters
startA valid index of the collection.
endAnother valid index of the collection. If
endis equal tostart, the result is zero.
Return Value
The distance between start and end.
Discussion
Complexity: O(n), where n is the resulting distance.