diff --git a/aadarshmishra.java b/aadarshmishra.java new file mode 100644 index 0000000..d5c97b0 --- /dev/null +++ b/aadarshmishra.java @@ -0,0 +1,27 @@ +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class AndroidWorkDay1 +{ + public static void main(String args[]) + { + Scanner s = new Scanner(System.in); + String text = s.nextLine(); + int n = s.nextInt(); + s.nextLine(); + List ans = new ArrayList(); + while(n-- > 0) { + String pat = s.nextLine(); + Pattern pattern = Pattern.compile(pat); + Matcher m = pattern.matcher(text); + while (m.find()) { + ans.add(m.start()); + } + } + Collections.sort(ans); + for(int i=0 ; i < ans.size() ; i++) { + System.out.print(ans.get(i) + " "); + } + } +} \ No newline at end of file