longest common prefix solution