public class ShortestCompletingWord { public static void main(String[] args) { String[] words = new String[] {"looks","pest","stew","show"}; String licensePlate = "1s3 456"; ShortestCompletingWord sc = new ShortestCompletingWord(); String cw = sc.shortestCompletingWord(licensePlate, words); System.out.println(cw); } private boolean check(String w, String lic) { int[] wmap = new int[256]; int[] lmap = new int[256]; for(int i=0; i