diff options
author | terminaldweller <thabogre@gmail.com> | 2022-04-04 20:32:19 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-04-04 20:32:19 +0000 |
commit | bee546b9efce8f576c85ecca70c896074a918468 (patch) | |
tree | 322c685eaee3841736479a016f4efd8d5fd15096 /876/main.cpp | |
parent | update (diff) | |
download | leetcode-bee546b9efce8f576c85ecca70c896074a918468.tar.gz leetcode-bee546b9efce8f576c85ecca70c896074a918468.zip |
update
Diffstat (limited to '')
-rw-r--r-- | 876/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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)]; } }; |