From 0a41b5abf533abdee877ef8896146d5bdf5230d6 Mon Sep 17 00:00:00 2001 From: Lam Haoyin Date: Fri, 18 Feb 2022 08:42:37 +0800 Subject: [PATCH] add: 220218-CN [C++] --- 2202/220218-CN.cpp | 8 ++++++++ 2202/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 2202/220218-CN.cpp diff --git a/2202/220218-CN.cpp b/2202/220218-CN.cpp new file mode 100644 index 0000000..22acc5f --- /dev/null +++ b/2202/220218-CN.cpp @@ -0,0 +1,8 @@ +#include + +class Solution { +public: + static int findCenter(const std::vector>& edges) { + return edges[0][(edges[0][0] == edges[1][0] || edges[0][0] == edges[1][1]) ? 0 : 1]; + } +}; \ No newline at end of file diff --git a/2202/CMakeLists.txt b/2202/CMakeLists.txt index ea4aeaa..4bda13e 100644 --- a/2202/CMakeLists.txt +++ b/2202/CMakeLists.txt @@ -3,4 +3,4 @@ PROJECT(2202) SET(CMAKE_CXX_STANDARD 23) -ADD_EXECUTABLE(2202 220217-CN.cpp) +ADD_EXECUTABLE(2202 220218-CN.cpp)