Determine if a string has all unique characters: Difference between revisions
Determine if a string has all unique characters (view source)
Revision as of 21:36, 30 December 2019
, 4 years ago→{{header|Haskell}}
(→{{header|Haskell}}: Added a variation (fusion) within the string-folding draft.) |
|||
Line 530:
(zip [0 ..] xs))))
-- OR, fusing filter, toList and minimumByMay down to a single fold:
duplicatedCharIndices_ :: String -> Maybe (Char, [Int])
duplicatedCharIndices_ xs =
|