No.1367 String Kadomatsu
Problem Statement
You are given a string S.
Determine whether the string can be made equal to kadomatsu by performing the following operation zero or more times.
- Insert any one character at any position. It may also be inserted at the beginning or at the end.
Input
$S$
$1 \le |S| \le 10$
It consists of lowercase letters.
Output
Print Yes if the string can be turned into kadomatsu by performing the insertion operation zero or more times,
and No otherwise.
Sample
Sample 1
Input
kadomatu
Output
Yes
This can be done by inserting s.
Sample 2
Input
yukicoder
Output
No
This is impossible. Making it ykadomatsukicoder would allow it to contain kadomatsu, but it would not be equal to it.
Sample 3
Input
kadomatsu
Output
Yes
It can be made into kadomatsu with zero insertions.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。