diff --git a/cpp/2203/220305-CN.cpp b/cpp/2203/220305-CN.cpp new file mode 100644 index 0000000..03666f0 --- /dev/null +++ b/cpp/2203/220305-CN.cpp @@ -0,0 +1,15 @@ +#include +#include + +class Solution { +public: + // clang does not accept constexpr + static inline int findLUSlength(const std::string& a, const std::string& b) { + return a == b ? -1 : static_cast(std::max(a.length(), b.length())); + } +}; + +int main() { + std::cout << Solution::findLUSlength("aaa", "bbb"); + return 0; +} diff --git a/cpp/2203/CMakeLists.txt b/cpp/2203/CMakeLists.txt index c6f0294..5fd9410 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 220304.cpp) +ADD_EXECUTABLE(2203 220305-CN.cpp)