Code for problem "longest common prefix".