# Input An alphanumeric string `s`. # Output The shortest string that occurs exactly once as a (contiguous) substring in `s`. Overlapping occurrences are counted as distinct. If there are several candidates of the same length, you must output all of them in the order of occurrence. In this challenge, the empty string occurs `n + 1` times in a string of length `n`. # Example Consider the string "asdfasdfd" The empty string occurs 10 times in it, so it is not a candidate for unique occurrence. Each of the letters `"a"`, `"s"`, `"d"`, and `"f"` occurs at least twice, so they are not candidates either. The substrings `"fa"` and `"fd"` occur only once and in this order, while all other substrings of length 2 occur twice. Thus the correct output is ["fa","fd"] # Rules Both functions and full programs are allowed, and standard loopholes are not. The exact formatting of the output is flexible, within reason. In particular, producing no output for the empty string is allowable, but throwing an error is not. The lowest byte count wins. # Test cases "" -> [""] "abcaa" -> ["b","c"] "rererere" -> ["ererer"] "asdfasdfd" -> ["fa","fd"] "ffffhhhhfffffhhhhhfffhhh" -> ["hffff","fffff","hhhhh","hfffh"] "asdfdfasddfdfaddsasadsasadsddsddfdsasdf" -> ["fas","fad","add","fds"] # Leaderboard Here's the by-language leaderboard that I promised. I'll try to keep this up do date, but you are also encouraged to point out any errors or fix them yourselves. - **CJam**: 40 by Optimizer - **GolfScript**: 44 by Peter Taylor - **J**: 44 by FUZxxl - **Java**: 169 by Geobits - **JavaScript**: 109 by edc65 - **Haskell**: 119 by proud haskeller - **Mathematica**: 79 by Martin Büttner - **PHP**: 125 by Stephen - **Pyth**: 26 by isaacg - **Python 2**: 150 by KSFT - **Python 3**: 96 by Sp3000 - **Scala**: 120 by Dominik Müller