g | x | w | all
Bytes Lang Time Link
175Python3250908T180700ZAjax1234
081CJam180622T105409ZErik the
131Python 2180620T175124ZErik the
168Python 2180620T155723ZRod
143Wolfram Language Mathematica180620T155513ZJungHwan

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

Try it online!

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;}*}

Try it online!

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

Try it online!

-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,]

Try it online!

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->" "&

Try it online!

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}}&