add solution for longestCommonPrefix