字符串子序列


Submit solution

Points: 10
Time limit: 1.0s
Memory limit: 4M

Author:
Problem type
Allowed languages
C, C++

字符串子序列

给定两个字符串 \(s\) 和 \(t\),如果 \(s\) 是 \(t\) 的子序列,则输出 true;否则输出 false。

字符串的子序列是从原始字符串中通过删除一些(可以是零个)字符而不改变剩余字符的相对位置形成的新字符串。(例如,"ace" 是 "abcde" 的子序列,而 "aec" 不是)。

示例 1:
输入:
abc
ahbgdc
输出:
true
示例 2:
输入:
axc
ahbgdc
输出:
false
约束条件:

\(0 \le s.length \le 100\)
\(0 \le t.length \le 10^4\)
s 和 t 只包含小写英文字母。


Comments

There are no comments at the moment.