# [Wolfram Language](https://www.wolfram.com/language/), <s>101</s> 100 bytes ```Mathematica StringJoin[Characters@#/.(r={"L"->-"R","U"->-"D"})//.{a___,x__,b___}/;Tr@{x}==0->{a,b}/.Reverse/@r]& ``` [Try it online!](https://tio.run/##PY1BC8IwDIXv/owKotCt3mWjYE@Sg0R7EhmddG6HTahFBqW/faZzGEj48vJ46Y1vbW989zBTU0wX77rheXp1w@3YGmce3rq3XIt864rAgGVlxpBxpmdSLO6EyIOpqoqP1DVBFIerk2GMRbHPymB4HUWO9kNBVkh330xn@uGFbIQMK6YBNWrGiVCB@iFQISIsrP@LJhN5QM2bAo2Yhpr9gKBIWMI0aXQjb4pVyZIEUuiSXsbpCw "Wolfram Language (Mathematica) – Try It Online") With some fancier formatting and comments: ```Mathematica StringJoin[ (*reconvert to input format*) Characters@# (*split into characters*) /. (r = {"L" -> -"R", "U" -> -"D"}) (*map L to -R and U to -D*) //. {a___, x__, b___} /; Tr@{x} == 0 -> {a, b} (*delete runs that sum to 0*) /. Reverse /@ r (*convert -R and -D back to L and U*) ]& ``` This takes a similar method to some of the others, deleting runs that sum to zero, but this one does it by replacing L and U with negative R and negative D respectively. Another **100 byte** solution that uses a similar but distinct technique, using [SequenceReplace](http://reference.wolfram.com/language/ref/SequenceReplace.html): ```Mathematica StringJoin@SequenceReplace[Characters@#/.(r={"L"->-"R","U"->-"D"}),{__}?(Tr@#==0&)->{}]/.Reverse/@r& ``` [Try it online!](https://tio.run/##PY3BCsIwDIbvPkYHMmFbfYHNgj1JDhrtSWSUkenATa3Vy9izz3SKOYT///Mlaa2/UGt9U9mxzse9d0133tyaTu3p8aKuIqT71VZ0XF@ss5Un91SRzGKX9wJEWqQCRSLMpLQYFklflsMqPjgV5flyvkiLfjjJDOnNmySVm49b/uGlqqXqZ8IAGjQiYYUa9FcCFyLCT5u/MQwxA3pyGgxiaHriAUFz8DtmOOMZs@GsDkgIOOFJeDlIuXs15McP "Wolfram Language (Mathematica) – Try It Online")