title: Connecting multiple small strings into one long string
body: <p>For example i have three strings:</p>
  <pre><code>manta
  alcats
  random
  </code></pre>
  <p>And i need to check, if is possible to connect this strings using first and last char to one long string. <strong>And i can not use any library.</strong></p>
  <p>In my example, it will return True, because it will be connected like:</p>
  <pre><code>randoMantAlcats
  </code></pre>
  <p>I tried backtracking, it works for small dataset, but for biggest one, it will took hours...</p>
  <p>So im looking for good and fast algorithm.</p>