@@ -0,0 +1,1061 @@
+package leetcode;%0A%0Apublic class Task3 %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(new Task3().lengthOfLongestSubstring(%22abcabcbb%22));%0A        System.out.println(new Task3().lengthOfLongestSubstring(%22bbbbb%22));%0A        System.out.println(new Task3().lengthOfLongestSubstring(%22pwwkew%22));%0A        System.out.println(new Task3().lengthOfLongestSubstring(%22 %22));%0A    %7D%0A%0A    public int lengthOfLongestSubstring(String s) %7B%0A        int maxSize = 0;%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A            int%5B%5D chars = new int%5B128%5D;%0A            chars%5Bs.charAt(i)%5D++;%0A            for (int j = i + 1; j %3C s.length(); j++) %7B%0A                if (chars%5Bs.charAt(j)%5D %3E 0) %7B%0A                    break;%0A                %7D%0A                chars%5Bs.charAt(j)%5D++;%0A            %7D%0A            int size = 0;%0A            for (int c : chars) %7B%0A                if (c == 1) %7B%0A                    size++;%0A                %7D%0A            %7D%0A            if (size %3E maxSize) %7B%0A                maxSize = size;%0A            %7D%0A        %7D%0A        return maxSize;%0A    %7D%0A%7D%0A

Add Task3