-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboj_6550.java
More file actions
34 lines (30 loc) · 954 Bytes
/
boj_6550.java
File metadata and controls
34 lines (30 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package greedy;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class boj_6550 {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb=new StringBuilder();
String str;
while((str=br.readLine())!=null){
StringTokenizer st=new StringTokenizer(str);
char[] s=st.nextToken().toCharArray();
char[] t=st.nextToken().toCharArray();
int i=0;
String result="No";
for(char c:t){
if(s[i]==c){
i++;
}
if(i==s.length){
result="Yes";
break;
}
}
sb.append(result).append('\n');
}
System.out.println(sb);
}
}