desguar += and -=

This commit is contained in:
2026-06-06 18:53:11 +02:00
parent 535364931e
commit 22874181cd
32 changed files with 185 additions and 146 deletions

View File

@@ -31,7 +31,7 @@ func part1[updates: Array, rules_left: Array, rules_right: Array] : void
for i in 0..updates->size
update : Array = array.nth(updates, i)
if check(update, rules_left, rules_right)
out = out + array.nth(update, update->size / 2)
out += array.nth(update, update->size / 2)
io.println_i64(out)
@@ -42,7 +42,7 @@ func part2[updates: Array, rules_left: Array, rules_right: Array] : void
update : Array = array.nth(updates, i)
if !check(update, rules_left, rules_right)
sort_by_rules(update, rules_left, rules_right)
out = out + array.nth(update, update->size / 2)
out += array.nth(update, update->size / 2)
io.println_i64(out)