Day 15: Lens Library [AOC2023 Python] @0xdf
Day 15: Lens Library [AOC2023 Python]  @0xdf
Uploaded December 2023 | Updated November 2026, 3 hours ago
For Advent of Code 2023 Day 15, I'm first asked to implement a custom (and bad) hashing algorithm that reduces any string to a single byte. I'll apply it to a series of strings in my puzzle input. In part 2, I'm actually handling those strings as instructions, either adding or removing a lens from one of 256 boxes. I'll hash the lens name to get what box it goes in, and track the order lenses are inserted into each box.

Code 2023 AOC: gitlab.com/0xdf/aoc2023
Challenge Link: adventofcode.com/2023/day/15

☕ Buy Me A Coffee: buymeacoffee.com/0xdf

[00:00] Part 1 description
[01:06] Input analysis
[01:38] Hash function
[02:30] Testing badhash
[02:52] Apply hash to input
[03:36] Solve part 1
[03:54] Part 2 description
[07:08] Sorting lenses
[12:43] Check sort result
[13:14] Scoring result
[14:31] Solve part 2
[14:45] Summary

#adventofcode #python
Day 15: Lens Library [AOC2023 Python]Day 7: Camel Cards [AOC2023 Python]Bypassing Python Filters [Code - HackTheBox]Reversing APT29 Duke MalwareDay 9: Mirage Maintenance [AOC2023 Python]Paper Shreds Easter Egg [Sans Holiday Hack 2024]Brute Forcing AES-ECB with Emoji [Hackvent 2022 - Day 20]PHPs Unsafe parse_url Function [Encoding - HackTheBox]ffuf Auto Calibration DemystifiedWriting a Webshell Joomla Plugin [HackTheBox - DevVortex]Laboratories [AOC2025 Day 7]NeoVault - HackTheSystem CTF
0xdf |

Day 15: Lens Library [AOC2023 Python]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER