Returns a Boolean value indicating whether the sequence precedes another sequence in a lexicographical (dictionary) ordering, using the less-than operator (
<) to compare elements.
- Xcode 8.3+
- Swift Standard Library
A sequence to compare to this sequence.
true if this sequence precedes
other in a dictionary ordering; otherwise,
This example uses the
lexicographically method to test which array of integers comes first in a lexicographical ordering.
Complexity: O(m), where m is the lesser of the length of the sequence and the length of