Longest Common Prefix python