import java.io.*; import java.util.*; /** * First, identify how long the shortest missing subsequences will be. * Do this by iterating over the string, and waiting for all characters to * appear before resetting the appeared characters and incrementing a counter. * * * @author Finn Lidbetter */ public class Naive { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] chAlphabet = br.readLine().toCharArray(); HashSet alphabetSet = new HashSet<>(); for (char ch: chAlphabet) { alphabetSet.add(ch); } char[] seq = br.readLine().toCharArray(); int targetLength = 1; HashSet seen = new HashSet<>(); for (int i=0; i(); targetLength++; } } int n = Integer.parseInt(br.readLine()); for (int i=0; i