Skip to content

Instantly share code, notes, and snippets.

View object's full-sized avatar

Vagif Abilov object

View GitHub Profile
@object
object / AdventOfCode2025.Day04.py
Created December 4, 2025 05:50
AdventOfCode2025.Day04.py
import pyperclip
input = pyperclip.paste().splitlines()
# Part One
grid = {}
for r in range(len(input)):
for c in range(len(input[r])):
grid[(int(r),int(c))] = input[r][c]
@object
object / AdventOfCode2025.Day02.fsx
Created December 2, 2025 07:40
AdventOfCode2025.Day02.fsx
#time "on"
open System
open System.IO
let input =
File.ReadAllText(__SOURCE_DIRECTORY__ + "/../data/input02.txt")
let ranges =
input.Split(',')
@object
object / AdventOfCode2025.Day01.fsx
Last active December 2, 2025 07:40
AdventOfCode2025.Day01.fsx
#time "on"
open System
open System.IO
let input =
File.ReadAllLines(__SOURCE_DIRECTORY__ + "/../data/input01.txt")
|> Seq.toList
@object
object / AdventOfCode2024.Day14.py
Last active December 14, 2024 14:22
Advent of Code 2024, day 14
import re
with open("./data/input14.txt") as inputFile:
input = inputFile.read().splitlines()
init = []
for line in input:
m = re.findall(r'p=(-?\d+),(-?\d+) v=(-?\d+),(-?\d+)', line)
p = (int(m[0][0]), int(m[0][1]))
@object
object / AdventOfCode2024.Day13.py
Created December 13, 2024 07:11
Advent of Code 2024, day 13
from itertools import groupby
import re
with open("./data/input13.txt") as inputFile:
input = inputFile.read().splitlines()
groups = [list(sub) for is_empty, sub in groupby(input, key = lambda x: x == '') if not is_empty]
machines = []
for group in groups:
@object
object / AdventOfCode2024.Day11.py
Last active December 11, 2024 11:07
Advent of Code 2024, day 11
import sys
from itertools import combinations
sys.setrecursionlimit(10**6)
with open("./data/input11.txt") as inputFile:
input = inputFile.read()
stones = []
for num in input.split(' '):
@object
object / AdventOfCode2024.Day10.py
Last active December 10, 2024 08:23
Advent of Code 2024, day 10
import sys
from itertools import combinations
sys.setrecursionlimit(10**6)
with open("./data/input10.txt") as inputFile:
input = inputFile.read().splitlines()
trailheads = []
grid = []
@object
object / AdventOfCode2024.Day09.py
Created December 9, 2024 08:36
Advent of Code 2024, day 09
with open("./data/input09.txt") as inputFile:
input = inputFile.read()
fs = []
total_free_blocks = 0
i = 0
while i < len(input):
file_id = i // 2
file_size = int(input[i])
free_blocks = 0 if i == len(input)-1 else int(input[i+1])
@object
object / AdventOfCode2024.Day08.py
Created December 8, 2024 08:36
Advent of Code 2024, day 08
import sys
from itertools import combinations
sys.setrecursionlimit(10**6)
with open("./data/input08.txt") as inputFile:
input = inputFile.read().splitlines()
antennas = {}
for r in range(len(input)):
@object
object / AdventOfCode2024.Day07.py
Created December 7, 2024 06:02
Advent of Code 2024, day 07
import sys
sys.setrecursionlimit(10**6)
with open("./data/input07.txt") as inputFile:
input = inputFile.read().splitlines()
equations = []
for line in input:
tokens = line.split(': ')