RangeReplaceableCollection
public extension RangeReplaceableCollection
An extension of RangeReplaceableCollection, which calculates the longest common subsequence between two collections.
-
Returns the longest common subsequence between two collections.
Declaration
Swift
func longestCommonSubsequence(_ collection: Self, by areEquivalent: (Element, Element) -> Bool) -> SelfParameters
collectionThe collection with which to compare the receiver.
areEquivalentA closure that returns a Boolean value indicating whether two elements are equivalent.
Return Value
The longest common subsequence between the receiver and the given collection.
-
Returns the longest common subsequence between two collections.
Declaration
Swift
func longestCommonSubsequence(_ collection: Self) -> SelfParameters
collectionThe collection with which to compare the receiver.
Return Value
The longest common subsequence between the receiver and the given collection.
RangeReplaceableCollection Extension Reference