Determine if a string has all unique characters: Difference between revisions
Determine if a string has all unique characters (view source)
Revision as of 22:05, 30 December 2019
, 4 years ago→{{header|Haskell}}
Line 541:
(zip [0 ..] xs))
where
go k [_] mb = mb -- Unique
go k xs Nothing = Just (k, xs) --
go k xs@(x:_) (Just (c, ys@(y:_)))
| otherwise
---------------------------TEST----------------------------
Line 566 ⟶ 564:
duplicatedCharIndices_
["", ".", "abcABC", "XYZ ZYX", "1234567890ABCDEFGHIJKLMN0PQRSTUVWXYZ"]
--------------------------DISPLAY--------------------------
|