Python Common Substring In List Of Strings In C