From bee546b9efce8f576c85ecca70c896074a918468 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Tue, 5 Apr 2022 01:02:19 +0430 Subject: update --- 876/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '876') diff --git a/876/main.cpp b/876/main.cpp index e9a9288..20d49ad 100644 --- a/876/main.cpp +++ b/876/main.cpp @@ -19,10 +19,11 @@ public: heads.push_back(head); head = head->next; } + heads.push_back(head); int size = heads.size(); std::cout << "size:" << size << "\n"; - return heads[(size / 2) - ((size - 1) % 2) + 1]; + return heads[int(size / 2)]; } }; -- cgit v1.2.3