@@ -0,0 +1,2169 @@
+import java.io.*;%0Aimport java.math.*;%0Aimport java.security.*;%0Aimport java.text.*;%0Aimport java.util.*;%0Aimport java.util.concurrent.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    // Complete the weightedUniformStrings function below.%0A    static String%5B%5D weightedUniformStrings(String s, int%5B%5D queries) %7B%0A        char%5B%5D c = s.toCharArray();%0A        int n = queries.length;%0A        Set%3CInteger%3E nums = new HashSet%3CInteger%3E();%0A        for(int i=0;i%3Cc.length;i++)%7B%0A            char x = c%5Bi%5D;%0A            int score = (int)x - 96;%0A            int a = 0;%0A            int list_size = 0;%0A            String y =%22%22;%0A            while(x==c%5Bi+a%5D)%7B%0A                y+=c%5Bi+a%5D;%0A                a++;%0A                //list.add(y);%0A                list_size++;%0A                nums.add(score*list_size);%0A                //System.out.println(y);%0A                if(i+a%3E=c.length) break;%0A            %7D%0A            if(a==1) continue;%0A            i=i+a-1;%0A        %7D%0A        String%5B%5D result = new String%5Bn%5D;%0A        for(int i=0;i%3Cn;i++)%7B%0A            if(nums.contains(queries%5Bi%5D)) result%5Bi%5D=%22Yes%22;%0A            else result%5Bi%5D=%22No%22;%0A        %7D%0A        return result;%0A    %7D%0A%0A    private static final Scanner scanner = new Scanner(System.in);%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv(%22OUTPUT_PATH%22)));%0A%0A        String s = scanner.nextLine();%0A%0A        int queriesCount = scanner.nextInt();%0A        scanner.skip(%22(%5Cr%5Cn%7C%5B%5Cn%5Cr%5Cu2028%5Cu2029%5Cu0085%5D)?%22);%0A%0A        int%5B%5D queries = new int%5BqueriesCount%5D;%0A%0A        for (int i = 0; i %3C queriesCount; i++) %7B%0A            int queriesItem = scanner.nextInt();%0A            scanner.skip(%22(%5Cr%5Cn%7C%5B%5Cn%5Cr%5Cu2028%5Cu2029%5Cu0085%5D)?%22);%0A            queries%5Bi%5D = queriesItem;%0A        %7D%0A%0A        String%5B%5D result = weightedUniformStrings(s, queries);%0A%0A        for (int i = 0; i %3C result.length; i++) %7B%0A            bufferedWriter.write(result%5Bi%5D);%0A%0A            if (i != result.length - 1) %7B%0A                bufferedWriter.write(%22%5Cn%22);%0A            %7D%0A        %7D%0A%0A        bufferedWriter.newLine();%0A%0A        bufferedWriter.close();%0A%0A        scanner.close();%0A    %7D%0A%7D%0A

add WeightedUniformString.java