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.180 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.179 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.178 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.177 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.176 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.175 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.174 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.173 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.172 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.171 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.170 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.169 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.167 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.166 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.165 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.164 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.163 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.162 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.161 tracks/julia/exercises/transpose/example.jl
trackler-2.2.1.160 tracks/julia/exercises/transpose/example.jl