[LC] Add solution to longest common prefix.