public static int lengthOfLongestSubstring(String s) {
		boolean[] a = new boolean[256];
		int count = 0;
		int length = s.length();
		if (length < 1) {
			return 0;
		}
		int max_length = Integer.MIN_VALUE;
		for (int i = 0; i < length; i++) {
			// initial a
			for (int j = 0; j < 256; j++) {
				a[j] = false;
			}
			count = 0;
			int j = i;
			while (j < length && !a[(int) s.charAt(j)]) {
				if (!a[(int) s.charAt(j)]) {
					a[(int) s.charAt(j)] = true;
					count++;
					j++;
				}
			}

			if (max_length < count)
				max_length = count;
		}

		return max_length;
	}