Comments
+1

Brute force search and largest common prefix, how can I never thought about it. Thank you!