@@ -0,0 +1,659 @@
+public class Solution %7B%0A    public int lengthOfLongestSubstring(String s) %7B%0A        /* Using a hashmap to store current string chracter and its position, when encounter%0A            a repeated char, update the hashmap and max length. */%0A        int max = 0;%0A        if (s == null)%7B%0A            return max;%0A        %7D%0A        if (s.length() == 1)%7B%0A            return 1;%0A        %7D%0A        Map%3CCharacter, Integer%3E map = new HashMap%3CCharacter, Integer%3E();%0A        for (int i = 0; i %3C s.length() -1; i++)%7B%0A            if (map.containsKey(s.charAt(i)))%7B%0A                max = i;%0A            %7D%0A            map.put(s.charAt(i), i);%0A        %7D%0A        return max;%0A    %7D%0A%7D

version 1 - compile but wrong output.