From 3327e4a2d9ef8a4c66347c38e5d256133500b21a Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Wed, 6 Dec 2023 09:51:41 +0100 Subject: [PATCH] Fixed a bug in the 01.cpp --- aoc/01.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aoc/01.cpp b/aoc/01.cpp index 4c7263e..0870f33 100644 --- a/aoc/01.cpp +++ b/aoc/01.cpp @@ -26,7 +26,7 @@ int main() { size_t index = current_str.find(item.second); while(index != std::string::npos){ - current_str.replace(index, item.second.length(), item.first); + current_str.replace(index, item.second.length() - 1, item.first); index = current_str.find(item.second); } }