Question: Say I have text like this (each word on one line, with no spaces)

```
Programming
Puzzles
&
Code
Golf

```

That makes no sense! It totally defies the laws of physics.

Your challenge is to remedy this impossible situation and collapse the text like so:

```
P
Prog
&uzz
Coderam
Golflesming

```

So that there is no empty space underneath any character but the characters retain their vertical order.

The goal is to satisfy the requirements but use the fewest bytes of source code possible.

Answer: 
Pyth, 10 bytes
==============

```
jb_.T.T_.z

```

Try it online in the [Pyth Compiler/Executor](https://pyth.herokuapp.com/?code=jb_.T.T_.z&input=Programming%0APuzzles%0A%26%0ACode%0AGolf&debug=0).

### Idea

We can achieve the desired output by applying four simple transformations:

1. Reverse the order of the lines:

```
Golf
Code
&
Puzzles
Programming

```
2. Transpose rows and columns:

```
GC&PP
oour
ldzo
fezg
lr
ea
sm
m
i
n
g

```

This top justifies, collapsing the original columns.
3. Transpose rows and columns:

```
Golflesming
Coderam
&uzz
Prog
P

```
4. Reverse the order of the lines:

```
P
Prog
&uzz
Coderam
Golflesming

```

### Code

```
        .z  Read the input as a list of strings, delimited by linefeeds.
       _    Reverse the list.
   .T.T     Transpose the list twice.
  _         Reverse the list.
jb          Join its strings; separate with linefeeds.

```
R, 171 bytes
============

```
S=scan(,"");while(any((D<-diff(N<-sapply(S,nchar)))<0)){n=max(which(D<0));S[n+1]=paste0(S[n+1],substr(S[n],N[n]+D[n]+1,N[n]));S[n]=substr(S[n],1,N[n]+D[n])};cat(S,sep="\n")

```

With newlines and indentation:

```r
S=scan(,"") #Takes input from stdin
while(any((D<-diff(N<-sapply(S,nchar)))<0)){
    n=max(which(D<0))
    S[n+1]=paste0(S[n+1],substr(S[n],N[n]+D[n]+1,N[n]))
    S[n]=substr(S[n],1,N[n]+D[n])
}
cat(S,sep="\n")

```

Usage:

```
> S=scan(,"");while(any((D<-diff(N<-sapply(S,nchar)))<0)){n=max(which(D<0));S[n+1]=paste0(S[n+1],substr(S[n],N[n]+D[n]+1,N[n]));S[n]=substr(S[n],1,N[n]+D[n])};cat(S,sep="\n")
1: Programming
2: Puzzles
3: &
4: Code
5: Golf
6: 
Read 5 items
P
Prog
&uzz
Coderam
Golflesming

```