Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Given two strings ~S_1~ and ~S_2~. You are asked to check if it is possible to delete some characters from ~S_1~ to make it become ~S_2~.
Input
- The first line is the string ~S_1~ ~(0 ≤ |S_1| ≤ 10^5)~.
- The second line is the string ~S_2~ ~(0 ≤ |S_2| ≤ 10^5)~.
- Both strings contain only lowercase characters.
Output
- Print
YES
(without quotes) if it is possible to delete some characters from ~S_1~ to make it become ~S_2~, otherwise printNO
.
Sample Input 1
abcdb
acb
Sample Output 1
YES
Sample Input 2
abcdb
adc
Sample Output 2
NO
Bình luận