REMOVING CHARACTERS

Xem dạng PDF

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:
Hà Minh Ngọc
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 print NO.

Sample Input 1

abcdb
acb

Sample Output 1

YES

Sample Input 2

abcdb
adc

Sample Output 2

NO

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.