Day 19 - An Elephant Named Joseph [Revival of Code 2023 - Advent of Code 2016] @0xdf
Day 19 - An Elephant Named Joseph [Revival of Code 2023 - Advent of Code 2016]  @0xdf
Uploaded July 2023 | Updated November 2026, 1 day ago
Python Discord is doing an event called Revival of Code, where we work through the 2016 Advent of Code, one challenge every two days. The day 19 challenge, An Elephant Named Joseph, starts with a classic math problem, The Josephus Problem. I'll include a link to the fantastic Numberphile video about this problem, and solve it very easily. The second part is a twist on the original, but still solvable by looking for patterns.

The Josephus Problem - Numberphile: youtube.com/watch?v=uCsD3ZGzMgE
Repo for Advent of Code 2016 Solutions: gitlab.com/0xdf/aoc2016
Intro video for this event: youtube.com/watch?v=qEPpsS0StQI
Configuring VSCode to debug PyTest: youtube.com/watch?v=zL2YTdIj3R8
Real Python post with templates: realpython.com/python-advent-of-code

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

[00:00] Introduction
[00:37] Challenge part 1
[01:25] Josephus problem background
[03:16] genday / input
[03:36] Test for part 1
[04:05] Part 1 solve
[05:29] Binary solution trick
[07:08] Challenge part 2
[07:52] Test for part 2
[08:12] Slow solution
[10:33] Simulating slow solutions
[11:29] Looking at patterns
[15:30] Building solution in simulation
[17:11] Converting simulation to part 2 solution
[18:05] Conclusion

#ctf #adventofcode #revivalofcode #python
Day 19 - An Elephant Named Joseph [Revival of Code 2023 - Advent of Code 2016]Linux 101 [Sans Holiday Hack 2023]Reassembling Werkzeugs Pin - Getting RCE in HackTheBox Agile [Part 2]Playing with a (CTF) Smart Contract [Hackvent 2022 - Day 6]Automating Malicious Zip with Symlinks [HackTheBox Zipping]Day 16: The Floor Will Be Laba [AOC2023 Python]Bridge Repair [Day 7 - Advent of Code 2024 - Python]Day 14: Parabolic Reflector Dish [AOC2023 Python]Day 23 - Safe Cracking [Revival of Code 2023 - Advent of Code 2016]Oddly Even [HackTheBox - Coding Challenge]Free AI HTB TutorDay 20: Pulse Propagation [AOC2023 Python]
0xdf |

Day 19 - An Elephant Named Joseph [Revival of Code 2023 - Advent of Code 2016]

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER