Longest Common Prefix problem