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.159 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.158 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.157 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.156 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.155 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.154 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.153 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.152 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.151 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.150 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.149 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.148 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.147 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.146 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.145 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.144 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.143 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.142 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.141 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.140 tracks/julia/exercises/transpose/example.jl