Sort by

recency

|

18 Discussions

|

  • + 0 comments

    To solve the problem, iterate through the string and keep track of characters already seen. Only add the first occurrence of each character to the result. This ensures all duplicates are removed, keeping the string’s order intact.

    This approach is efficient and useful, just like reliable IT Support and Maintenance Australia helps businesses keep their systems clean and running smoothly without repeated issues.

  • + 0 comments

    Simply needed to say I truly can't stand Haskell. Took me two months to sort out some way to understand strings and work with them electric hedge trimmers..

  • + 0 comments

    f# solution

    open System
    
    Console.ReadLine()
    |> Seq.toList
    |> List.distinct
    |> Seq.map string
    |> String.concat ""
    |> Console.WriteLine
    
  • + 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
    
  • + 0 comments

    how to write code in c++ in this ?