Sha256: c58bd707a8252e06d8728ee754063ed588cc6291511e4018c716f2e2f49fa6d6

Contents?: true

Size: 281 Bytes

Versions: 384

Compression:

Stored size: 281 Bytes

Contents

module BookKeeping
  VERSION = 1
end

class Transpose
  def self.transpose(input)
    lines = input.split("\n")
    max_line_length = lines.map(&:length).max

    lines
      .map { |line| line.ljust(max_line_length).chars }
      .transpose.map(&:join).join("\n").strip
  end
end

Version data entries

384 entries across 384 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.179 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.178 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.177 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.176 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.175 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.174 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.173 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.172 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.171 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.170 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.169 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.167 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.166 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.165 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.164 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.163 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.162 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.161 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb
trackler-2.2.1.160 tracks/ruby/exercises/transpose/.meta/solutions/transpose.rb