Sha256: f81708171cdf60ca81bf7615a1ff82aa795bc28a2530516bc44e34d9184afbf9

Contents?: true

Size: 809 Bytes

Versions: 139

Compression:

Stored size: 809 Bytes

Contents

Given an input text output it transposed.

Roughly explained, the transpose of a matrix:

```text
ABC
DEF
```

is given by:

```text
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:

```text
ABC
DE
```

results in:

```text
AD
BE
C
```

And transposing:

```text
AB
DEF
```

results in:

```text
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

139 entries across 139 versions & 1 rubygems

Version Path
trackler-2.2.1.180 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.179 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.178 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.177 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.176 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.175 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.174 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.173 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.172 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.171 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.170 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.169 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.167 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.166 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.165 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.164 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.163 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.162 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.161 problem-specifications/exercises/transpose/description.md
trackler-2.2.1.160 problem-specifications/exercises/transpose/description.md