• + 0 comments

    f# solution

    open System
    
    let swap str =
        str
        |> Seq.chunkBySize 2
        |> Seq.map Seq.rev
        |> Seq.concat
        |> Seq.map string
        |> String.concat ""
    
    [<EntryPoint>]
    let main args =
        let n = Console.ReadLine() |> int
    
        [ 1..n ]
        |> Seq.map (fun _ -> Console.ReadLine())
        |> Seq.map swap
        |> Seq.iter Console.WriteLine
    
        0