For this Question: Given a string S, you have to find the length of the longest substring of S such that all characters are unique in the substring i.e no character is repeating within that substring.

For example, for input string S = "abcama", the output is 3 as "abc" is the longest substring with distinct characters.The first line of input contains an integer T denoting the number of test cases.
The first and the only line of each test case contains the string S.

Constraints:
1 ≤ T ≤ 100
1 ≤ length of S ≤ 1000Print length of longest substring having such that all characters are unique .
Sample Input:
2
abababcdefababcdab
gccksfvrgccks

Sample Output:
6
7, I have written this Solution Code: import java.io.*;
import java.util.*;
class Main {
    public static void main (String[] args) throws IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int t=Integer.parseInt(br.readLine());
        while(t>0) {
            t--;
            char [] arr = br.readLine().toCharArray();
            int [] hash = new int[256];
            int i = 0,j=0,max=0;
            while(j != arr.length) {
                hash[arr[j]]++;
                while (hash[arr[j]] > 1) {
                    hash[arr[i]]--;
                    i++;
                }
                max = Math.max(max, j-i+1);
                j++;
            }
            System.out.println(max);
        }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?