Spaceship operator - Day 07 - Advent of Code 2023

This video tackles the "Camel Cards" poker puzzle. We’ll parse the input data into Hand objects, modeling ranks, and bids. We can sort hands by type and strength by including the Comparable module and implementing spaceship logic.

For part 1, we’ll build a card counter and hand typing system, assigning numeric ranks. This lets us multiply bids by position to get total winnings. For part 2's joker rules, we’ll tweak the ranks and add joker offset logic to promote hands.

The core solution focuses on custom classes and comparable spaceships for sorting. I polish with enumerable pipelines for a concise answer. While not golf code, we end up with readable Ruby leveraging objects, sorting, and clever tricks.

Advent of Code:
My Solutions:

#adventofcode #ruby