add: 220302-CN [cpp]
This commit is contained in:
parent
7c317607f4
commit
bf1382494e
|
|
@ -0,0 +1,17 @@
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class Solution {
|
||||||
|
public:
|
||||||
|
static bool isSubsequence(const std::string& t, const std::string& s) {
|
||||||
|
int m = s.length(), n = t.length(), i = 0, j = 0;
|
||||||
|
while (i < m && j < n) {
|
||||||
|
if (s[i++] == t[j])
|
||||||
|
++j;
|
||||||
|
}
|
||||||
|
return j == n;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
@ -3,4 +3,4 @@ PROJECT(2203)
|
||||||
|
|
||||||
SET(CMAKE_CXX_STANDARD 23)
|
SET(CMAKE_CXX_STANDARD 23)
|
||||||
|
|
||||||
ADD_EXECUTABLE(2203 220302-CN.cpp)
|
ADD_EXECUTABLE(2203 220302.cpp)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue