AdventOfCode2022/03/README.md
2023-12-09 13:46:15 +01:00

698 B

Day 3

🎁🎁🎁

Today's language: C

Lines of code: 78

Execution time: 0,001 s

Extra: Task 1 in vimscript, generated by OpenAI with just a few fixes by myself

All the characters (the Elf's items) occuring in (half) a line (backpack) are stored as bits in an unsigned long, duplicate characters can then be determined by bitwise and-ing these numbers.

# Find the item type that appears in both compartments of each rucksack. What is the sum of the priorities of those item types?
gcc main.c -o day3
./day3

# OpenAI vim script
vim rucksack_items.txt
# in vim:
# :source day3-1.vim