If so, I think it's unfair.

```
public class Solution {
public int lengthOfLongestSubstring(String s) {
char[] sc = s.toCharArray();
int[] hash = new int[256];
int max = 0, i = 0, j = 0;
for (; j < sc.length; j++) {
if (hash[(int)sc[j]] != 0) {
max = Math.max(max, j-i);
i = Math.max(hash[(int)sc[j]], i);
}
hash[(int)sc[j]] = j+1;
}
return Math.max(max, j-i);
}
}
```