• + 0 comments

    Elixir solution:

    defmodule Solution do
        def dedupe(input) do
            String.codepoints(input)
            |> Enum.reduce("", fn x, acc ->
                if String.contains?(acc, x) do
                    acc
                else  
                    acc <> x
                end
            end)
        end
    end
    
    input = IO.read(:stdio, :all)
    
    Solution.dedupe(input)
    |>IO.puts