mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
Don’t unique the lists.
This commit is contained in:
parent
04eb0126e2
commit
5428115895
@ -48,8 +48,8 @@ rws compare getLabel as bs
|
|||||||
longestIncreasingSubsequence :: Ord a => [a] -> [a]
|
longestIncreasingSubsequence :: Ord a => [a] -> [a]
|
||||||
longestIncreasingSubsequence = longestOrderedSubsequenceBy (<)
|
longestIncreasingSubsequence = longestOrderedSubsequenceBy (<)
|
||||||
|
|
||||||
longestOrderedSubsequenceBy :: Eq a => (a -> a -> Bool) -> [a] -> [a]
|
longestOrderedSubsequenceBy :: (a -> a -> Bool) -> [a] -> [a]
|
||||||
longestOrderedSubsequenceBy isOrd = maximumBy (comparing length) . fmap List.nub . filter (isSortedBy isOrd) . subsequences
|
longestOrderedSubsequenceBy isOrd = maximumBy (comparing length) . filter (isSortedBy isOrd) . subsequences
|
||||||
|
|
||||||
isSorted :: Ord a => [a] -> Bool
|
isSorted :: Ord a => [a] -> Bool
|
||||||
isSorted = isSortedBy (<=)
|
isSorted = isSortedBy (<=)
|
||||||
|
Loading…
Reference in New Issue
Block a user