You are viewing a single comment's thread. Return to all comments →
Elixir solution of the "String-o-Permute"
defmodule Solution do def permutate(string) do string |> String.codepoints |> Enum.chunk_every(2) |> Enum.map(fn [x, y] -> [y, x] end) |> List.flatten |> Enum.join end def main do IO.read(:stdio, :all) |> String.split("\n") |> Enum.drop(1) |> Enum.map(&permutate(&1)) |> Enum.join("\n") |> IO.puts end end Solution.main
Seems like cookies are disabled on this browser, please enable them to open this website
String-o-Permute
You are viewing a single comment's thread. Return to all comments →
Elixir solution of the "String-o-Permute"