Solved longest common prefix.