finish Longest Common Prefix