aboutsummaryrefslogtreecommitdiffstats
path: root/876
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-04-04 20:32:19 +0000
committerterminaldweller <thabogre@gmail.com>2022-04-04 20:32:19 +0000
commitbee546b9efce8f576c85ecca70c896074a918468 (patch)
tree322c685eaee3841736479a016f4efd8d5fd15096 /876
parentupdate (diff)
downloadleetcode-bee546b9efce8f576c85ecca70c896074a918468.tar.gz
leetcode-bee546b9efce8f576c85ecca70c896074a918468.zip
update
Diffstat (limited to '876')
-rw-r--r--876/main.cpp3
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)];
}
};