Longest Common Prefix (basic version)