How to move the selected item to move to the top of the list
<pre><code>List&lt;String&gt; strings; // contains "foo", "bar", "baz", "xyz"
</code></pre>

<p>and if given an input <code>"baz"</code> the function re-arrange(String input) should return the strings</p>

<pre><code>"baz", "foo", "bar", "xyz"
</code></pre>

<p>and if given an input <code>"bar"</code> the function re-arrange(String input) should return the strings</p>

<pre><code>"bar", "foo", "baz", "xyz"
</code></pre>
