Wednesday, July 22, 2020

Leetcode 1040: Longest duplicate string


Longest duplicate string is binary search with hash

Binary search for the length, use Robin karp hash

Question about Leetcode 1040:



There is no pattern string, how to find which one to compare. Save all the same length one in the hashset? Rabin hash is to compare to given a pattern string.

Here is my gist saved. I will play Java code and see how it works. 



No comments:

Post a Comment