Skip to content

Instantly share code, notes, and snippets.

@whiter4bbit
whiter4bbit / aoc.md
Created December 29, 2025 01:45
aoc

--- Day 9: Movie Theater ---

You slide down the firepole in the corner of the playground and land in the North Pole base movie theater!

The movie theater has a big tile floor with an interesting pattern. Elves here are redecorating the theater by switching out some of the square tiles in the big grid they form. Some of the tiles are red; the Elves would like to find the largest rectangle that uses red tiles for two of its opposite corners. They even have a list of where the red tiles are located in the grid (your puzzle input).

For example:

7,1 11,1

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct Node {
int value;
struct Node *next;
} Node;
typedef struct Circle {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
use std::fs;
use std::io;
use std::str::FromStr;
#[derive(Debug, Clone)]
enum Pattern {
Char {
c: u8,
},
And {
use std::fs;
use std::io;
use std::str::FromStr;
#[derive(Debug, Clone)]
enum Pattern {
Char {
c: u8,
},
And {
use std::collections::{HashMap, HashSet};
use std::convert::Into;
use std::fs;
use std::io;
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
struct Point {
d: [i64; 4],
}
use std::collections::{HashMap, HashSet};
use std::convert::Into;
use std::fs;
use std::io;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
struct Point {
d: [i64; 4],
}
use std::io;
use regex::Regex;
use std::fs;
use std::str::FromStr;
use std::convert::Into;
use std::ops::RangeInclusive;
use std::collections::{HashMap, VecDeque};
type Ticket = Vec<u32>;
use std::io;
use std::fs;
use std::str::FromStr;
use std::convert::TryInto;
use std::collections::HashMap;
#[derive(Debug, Clone)]
enum Instruction {
Mask(u64, u64, u64),
Set(u64, u64),
@whiter4bbit
whiter4bbit / day4.rs
Last active December 4, 2020 14:05
AOC-2020: Day 4
use regex::Regex;
use std::io;
use std::ops::RangeInclusive;
use std::fs;
use std::collections::HashMap;
use std::str::FromStr;
fn match_re(re: &str, text: &str, captured_range: Option<RangeInclusive<i32>>) -> bool {
Regex::new(re).ok().and_then(|re|