Problem

Source: USA TSTST 2014, Problem 1

Tags: induction, symmetry, algorithm, Euler, combinatorics



Let $\leftarrow$ denote the left arrow key on a standard keyboard. If one opens a text editor and types the keys "ab$\leftarrow$ cd $\leftarrow \leftarrow$ e $\leftarrow \leftarrow$ f", the result is "faecdb". We say that a string $B$ is reachable from a string $A$ if it is possible to insert some amount of $\leftarrow$'s in $A$, such that typing the resulting characters produces $B$. So, our example shows that "faecdb" is reachable from "abcdef". Prove that for any two strings $A$ and $B$, $A$ is reachable from $B$ if and only if $B$ is reachable from $A$.