Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main{
- public static void main(String args[]){
- Scanner tc = new Scanner(System.in);
- String p,s,t;
- String[] sa;
- while(tc.hasNextLine()){
- p = tc.nextLine(); sa = p.split(" ");
- s = sa[0]; t = sa[1];
- int j=0,i=0;
- while(i<t.length() && j<s.length()){
- if(t.charAt(i)==s.charAt(j)){ i++; j++; }
- else i++;
- }
- if(j==s.length()) System.out.println("Yes");
- else System.out.println("No");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment