diff --git a/src/main.rs b/src/main.rs index 59c4969..56e0e42 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,6 +41,7 @@ fn get_sum_priorities_errors(rucksacks: Vec) -> u32 { // we have found the error let priority = item.get_priority(); total_priority_errors += priority; + // break out so that we don't double count the error if it appears twice break; } }