Jump to content

Determine if a string has all unique characters: Difference between revisions

→‎{{header|Haskell}}: Edit to preamble of alternative draft (fold string to Map)
(→‎Python :: Functional: Updated alternative to sort+group :: folding a string down to a dictionary with reduce.)
(→‎{{header|Haskell}}: Edit to preamble of alternative draft (fold string to Map))
Line 509:
"1234567890ABCDEFGHIJKLMN0PQRSTUVWXYZ" (36) -> '0' (0x30) at 9, 24</pre>
 
 
Or perhaps, as an alternative to grouping and sorting – folding a string down to a Map of indices:
<lang haskell>import qualified Safe as S
import qualified Data.Map.Strict as M
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.