My easy solution in JAVA (O(N)) .
public class Solution {\n        public int lengthOfLongestSubstring(String s) {\n            int[] mOccur = new int[256];\n            int maxL = 0;\n         
    public class Solution {\n        public int lengthOfLongestSubstring(String s) {\n            int[] mOccur = new int[256];\n            int maxL = 0;\n            for(int i = 0, j = 0; i < s.length(); ++i){\n                char ch = s.charAt(i);\n                ++mOccur[ch];\n                while(mOccur[ch] > 1){\n                    --mOccur[s.charAt(j++)];\n                }\n                maxL = Math.max(maxL, i - j + 1);\n            }\n            return maxL;\n        }\n    }
['Hash Table', 'Java']