You are viewing a single comment's thread. Return to all comments →
removeDuplicates :: String -> String removeDuplicates string = foldl (\acc char -> if char `elem` acc then acc else acc ++ [char]) [] string main = do line <- getLine putStr $ removeDuplicates line
Seems like cookies are disabled on this browser, please enable them to open this website
Remove Duplicates
You are viewing a single comment's thread. Return to all comments →