Sha256: a2bba133beb5f7683c446ddba3676137d74fca887726f1494ca5bce1cb49c0a7

Contents?: true

Size: 811 Bytes

Versions: 84

Compression:

Stored size: 811 Bytes

Contents

Write a program that takes input text and outputs it -- transposed.

Roughly explained, the transpose of a matrix:

```
ABC
DEF
```

is given by:

```
AD
BE
CF
```

Rows become columns and columns become rows. See <https://en.wikipedia.org/wiki/Transpose>.

If the input has rows of different lengths, this is to be solved as follows:

- Pad to the left with spaces.
- Don't pad to the right.

Therefore, transposing this matrix:

```
ABC
DE
```

results in:

```
AD
BE
C
```

And transposing:

```
AB
DEF
```

results in:

```
AD
BE
 F
```

In general, all characters from the input should also be present in the transposed output.
That means that if a column in the input text contains only spaces on its bottom-most row(s), 
the corresponding output row should contain the spaces in its right-most column(s).

Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
trackler-2.0.6.28 common/exercises/transpose/description.md
trackler-2.0.6.27 common/exercises/transpose/description.md
trackler-2.0.6.26 common/exercises/transpose/description.md
trackler-2.0.6.25 common/exercises/transpose/description.md
trackler-2.0.6.24 common/exercises/transpose/description.md
trackler-2.0.6.23 common/exercises/transpose/description.md
trackler-2.0.6.22 common/exercises/transpose/description.md
trackler-2.0.6.21 common/exercises/transpose/description.md
trackler-2.0.6.20 common/exercises/transpose/description.md
trackler-2.0.6.19 common/exercises/transpose/description.md
trackler-2.0.6.18 common/exercises/transpose/description.md
trackler-2.0.6.17 common/exercises/transpose/description.md
trackler-2.0.6.16 common/exercises/transpose/description.md
trackler-2.0.6.15 common/exercises/transpose/description.md
trackler-2.0.6.14 common/exercises/transpose/description.md
trackler-2.0.6.13 common/exercises/transpose/description.md
trackler-2.0.6.12 common/exercises/transpose/description.md
trackler-2.0.6.11 common/exercises/transpose/description.md
trackler-2.0.6.10 common/exercises/transpose/description.md
trackler-2.0.6.9 common/exercises/transpose/description.md