例如,这是一个我们给它一个输入的问题
ahhellllloou
如果在示例中可以删除一些字母或忽略它们,最后我们到达hello
,则必须print('YES') else print('NO')
例如:
input = 'ahhellllloou' output = 'YES' input = 'hlelo' output = 'NO'
-因为在这个输入中我们无法找到hello单词,所以它是hlelo
不是hello
另一个例子是'hezzrtlilo'
,我们可以删除zzrt
和我,然后看到“hello”,在这种情况下,答案必须是真的,因为最后我们看到hello
另一个例子:input = 'tymbzjyqhymedasloqbq' output = 'NO'
-因为在这个输入中,我们可以到达helo,它有一个l而不是两个ll
假设您正在检查一个字符串是否是另一个字符串的子序列
测试
输出
相关问题 更多 >
编程相关推荐