solution: longest common prefix 1