add: 220305-CN [cpp]
This commit is contained in:
parent
fa8c94af11
commit
1743eb1ab3
|
|
@ -0,0 +1,15 @@
|
|||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
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<int>(std::max(a.length(), b.length()));
|
||||
}
|
||||
};
|
||||
|
||||
int main() {
|
||||
std::cout << Solution::findLUSlength("aaa", "bbb");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -3,4 +3,4 @@ PROJECT(2203)
|
|||
|
||||
SET(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
ADD_EXECUTABLE(2203 220304.cpp)
|
||||
ADD_EXECUTABLE(2203 220305-CN.cpp)
|
||||
|
|
|
|||
Loading…
Reference in New Issue