| Bytes | Lang | Time | Link |
|---|---|---|---|
| 175 | Python3 | 250908T180700Z | Ajax1234 |
| 081 | CJam | 180622T105409Z | Erik the |
| 131 | Python 2 | 180620T175124Z | Erik the |
| 168 | Python 2 | 180620T155723Z | Rod |
| 143 | Wolfram Language Mathematica | 180620T155513Z | JungHwan |
Python3, 175 bytes
K=[(0,1),(1,0)]
def f(s):
b,x,y,V,d=[[' ']*len(s)for _ in s],0,0,0,{}
for i in s:
if i in d:x,y=d[i];d={};V+=1
else:b[x][y]=i;d[i]=(x,y)
X,Y=K[V%2];x+=X;y+=Y
return b
CJam, 81 bytes
{_,_S*a*a\+{__L#){V!:V;L#)LM:L;=~:U;:T}{[TU]a+L+:L}?;U@_U=T4$tt\;TV!+:T;UV+:U;}*}
Python 2, 131 bytes
X=Y=y=0
s=input()
o=()
l={}
for i in s:o+=[' ']*len(s),;exec('l[i]=X,Y','y^=1;X,Y=l[i];l={}')[i in l];o[Y][X]=i;X+=y<1;Y+=y
print o
-1 thanks to Lynn.
Prints as a tuple of lists of length-1 strings. Pretty-printed output.
Python 2, 184 176 175 168 bytes
-5 bytes thanks to Mr. Xcoder
def f(x):i,k=[p for p in enumerate(map(x.find,x+"z"))if cmp(*p)][0];return[x[:i]+' '*len(x)]+[' '*k+''.join(d)+i*' 'for d in zip(*f(x[i+1:]))]if x[len(set(x)):]else[x,]
Wolfram Language (Mathematica), 143 bytes
{#}//.{q___,a_,r___,a_,Longest@s___}:>{q}~f@{a,r}~{{s}}//.{q_~f@a_~s_}/;s~FreeQ~f:>(PadLeft@{q~Join~#,##2}&)@@PadRight@Join[{a},s]/. 0->" "&
Contains 0xF8FF, which corresponds to the \[Transpose] operator.
Phew, it was tough making the result into a string. Getting each branch isn't so tough: #//.{q___,a_,r___,a_,Longest@s___}:>{q,a,{r},{s}}&