aboutsummaryrefslogtreecommitdiff
path: root/2024/src/day19.cpp
diff options
context:
space:
mode:
Diffstat (limited to '2024/src/day19.cpp')
-rw-r--r--2024/src/day19.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/2024/src/day19.cpp b/2024/src/day19.cpp
index 43995b1..c114d2a 100644
--- a/2024/src/day19.cpp
+++ b/2024/src/day19.cpp
@@ -92,11 +92,8 @@ part2(const tuple<set<string>, vector<string>>& data)
92 92
93 long counter = 0; 93 long counter = 0;
94 for ( size_t i = 0; i != line.size(); ++i ) { 94 for ( size_t i = 0; i != line.size(); ++i ) {
95 auto lhs = line.substr(0, i + 1); 95 if ( parts.contains(line.substr(0, i + 1)) ) {
96 auto rhs = line.substr(i + 1); 96 counter += match(line.substr(i + 1));
97
98 if ( parts.contains(lhs) ) {
99 counter += match(rhs);
100 } 97 }
101 } 98 }
102 99