Sha256: 7273e584f24432359e7767d7125552c19dccccaa846b20a164a782e9b2cbaf26

Contents?: true

Size: 546 Bytes

Versions: 307

Compression:

Stored size: 546 Bytes

Contents

function transpose_strings(input::AbstractArray)
    cols = length(input)
    cols == 0 && return []
    rows = maximum(map(x->length(x), input))
    result = fill("", rows)
    for i = 1:rows
        for j = 1:cols
            sym = ""
            if i <= length(input[j])
                delta = j-length(result[i])-1
                if delta > 0
                    sym = " " ^ delta
                end
                sym = sym * string(input[j][i])
            end
            result[i] = result[i] * sym
        end
    end
    result
end

Version data entries

307 entries across 307 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.138 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.137 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.136 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.135 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.134 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.133 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.132 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.131 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.130 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.129 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.128 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.127 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.126 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.125 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.124 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.123 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.122 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.121 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.120 tracks/julia/exercises/transpose/example.jl