add solution for longest common prefix