Echo Detector
Hardstringshashingbinary search
A replay log is one long string of move letters. An *echo* is a block of moves that appears at least twice in the log; the two copies may overlap.
Return the length of the longest echo, or 0 if no block appears twice. The largest test is 1,500 moves long.
Examples
Input: log = "UDLRUDLX"
Output: 3
Input: log = "UDLR"
Output: 0
Input: log = "UUUU"
Output: 3