Zigzag this string by collapsing duplicates
Wolfram Language (Mathematica), 143 bytes

{#}//.{q___,a_,r___,a_,Longest@s___}:&gt;{q}~f@{a,r}~{{s}}//.{q_~f@a_~s_}/;s~FreeQ~f:&gt;(PadLeft@{q~Join~#,##2}&amp;)@@PadRight@Join[{a},s]/. 0-&gt;" "&amp;


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___}:&gt;{q,a,{r},{s}}&amp;