add solution to longestSubstring