diff --git a/cpp/2203/220302.cpp b/cpp/2203/220302.cpp new file mode 100644 index 0000000..5ad7c87 --- /dev/null +++ b/cpp/2203/220302.cpp @@ -0,0 +1,17 @@ +#include + +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; +} diff --git a/cpp/2203/CMakeLists.txt b/cpp/2203/CMakeLists.txt index 71f8484..d8a769f 100644 --- a/cpp/2203/CMakeLists.txt +++ b/cpp/2203/CMakeLists.txt @@ -3,4 +3,4 @@ PROJECT(2203) SET(CMAKE_CXX_STANDARD 23) -ADD_EXECUTABLE(2203 220302-CN.cpp) +ADD_EXECUTABLE(2203 220302.cpp)