시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 18 5 5 31.250%

문제

2개의 문자열 s와 t가 주어졌을 때 s가 t의 부분 문자열인지 판단하는 프로그램을 작성하라. 부분 문자열을 가지고 있는지 판단하는 방법은 t에서 몇 개의 문자를 제거하고 이를 순서를 바꾸지 않고 합쳤을 경우 s가 되는 경우를 이야기 한다.

입력

입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 한 줄로 이루어져 있으며, 문자열 s 와 t가 빈칸을 사이에 두고 들어온다. s와 t의 길이는 10만을 넘지 않는다.

출력

입력된 s와 t의 순서대로 s가 t의 부분 문자열인 경우 Yes라 출력하고 아닐 경우 No라고 출력한다.

예제 입력 1

sequence subsequence
person compression
VERDI vivaVittorioEmanueleReDiItalia
caseDoesMatter CaseDoesMatter

예제 출력 1

Yes
No
Yes
No

힌트

W3sicHJvYmxlbV9pZCI6IjY1NTAiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWJkODBcdWJkODQgXHViYjM4XHVjNzkwXHVjNWY0IiwiZGVzY3JpcHRpb24iOiI8cD4yXHVhYzFjXHVjNzU4IFx1YmIzOFx1Yzc5MFx1YzVmNCBzXHVjNjQwIHRcdWFjMDAgXHVjOGZjXHVjNWI0XHVjODRjXHVjNzQ0IFx1YjU0YyBzXHVhYzAwIHRcdWM3NTggXHViZDgwXHViZDg0IFx1YmIzOFx1Yzc5MFx1YzVmNFx1Yzc3OFx1YzljMCBcdWQzMTBcdWIyZThcdWQ1NThcdWIyOTQgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzQ0IFx1Yzc5MVx1YzEzMVx1ZDU1OFx1Yjc3Yy4gXHViZDgwXHViZDg0IFx1YmIzOFx1Yzc5MFx1YzVmNFx1Yzc0NCBcdWFjMDBcdWM5YzBcdWFjZTAgXHVjNzg4XHViMjk0XHVjOWMwIFx1ZDMxMFx1YjJlOFx1ZDU1OFx1YjI5NCBcdWJjMjlcd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