Create the longest common prefix with the direct neighbour | Guide to High School Computer Science