You are viewing a single comment's thread. Return to all comments →
An F# Solution
let rec change (t:string) x = if x = t.Length-2 then Console.WriteLine(t.[x+1].ToString() + t.[x].ToString()) else Console.Write(t.[x+1].ToString() + t.[x].ToString()) change t (x+2) [<EntryPoint>] let main argv = let n = Console.ReadLine() |> int let c = [for i = 1 to n do yield Console.ReadLine()] c |> List.iter(fun x -> change x 0) 0
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 →
An F# Solution