Longest Non Repeating Substring Leetcode Javascript