Day 3: Rucksack Reorganization
Day 3 involves finding common items in rucksacks and determining their priorities.
Problem Overview
Elves packed their rucksacks incorrectly, and you need to help them find the misplaced items. Each rucksack has two compartments, and items of the same type should go in the same compartment. Your tasks:
- Find items that appear in both compartments of each rucksack
- Find badges (items common to each group of three elves)
- Calculate the sum of priorities for these items
Each item type is identified by a single letter (case-sensitive) and has a priority value:
- Lowercase letters (a-z) have priorities 1-26
- Uppercase letters (A-Z) have priorities 27-52
Navigation
- Problem Description: Detailed description of the day's challenge
- Solution Explanation: Walkthrough of the approach used
- Code: The complete implementation with comments