Skip to main content
6 of 6
Edit header for leaderboard snippet.
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

PHP, 171 152 134 125

function f($s){while(!$a&&++$i<strlen($s))for($j=0;$b=substr($s,$j++,$i);)strpos($s,$b)==strrpos($s,$b)&&($a[]=$b);return$a;}

http://3v4l.org/RaWTN

Stephen
  • 201
  • 1
  • 4