package hackerrank;

import java.util.Scanner;

/**
 * https://www.hackerrank.com/challenges/string-construction
 */
public class StringConstruction {
    private static int stringConstruction(String str) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for (int i = 0; i < n; i++) {
            String str = in.next();
            System.out.println(stringConstruction(str));
        }
    }
}

@@ -31,23 +31,71 @@
 va.util.
-Scanner
+HashSet;%0Aimport java.util.Scanner;%0Aimport java.util.Set
 ;%0A%0A/**%0A 
@@ -260,32 +260,229 @@
     
-// TODO%0A        return 0
+int count = 0;%0A        Set%3CCharacter%3E set = new HashSet%3C%3E();%0A        for (int i = 0; i %3C str.length(); i++) %7B%0A            if (set.add(str.charAt(i))) %7B%0A                count++;%0A            %7D%0A        %7D%0A        return count
 ;%0A  
@@ -627,23 +627,26 @@
 int 
-i
+a0
  = 0; 
-i
+a0
  %3C n; 
-i
+a0
 ++) 
@@ -667,18 +667,16 @@
 String s
-tr
  = in.ne
@@ -732,18 +732,16 @@
 uction(s
-tr
 ));%0A    

Solve String Construction