LOADING: An error occurred. Update Chrome, try Firefox, or visit this post for more details.

⚠️Reddit changed how removals work, which breaks Reveddit's website. Install the extension to track removed content:Add to chromeAdd to firefoxWhat changed?
✖︎
about reveddit
⚙F.A.Q.add-ons
r/
status
copy sharelink
[+] show filters
46
SOLUTION MEGATHREAD-🎄- 2021 Day 16 Solutions -🎄-(self.adventofcode)
submitted 4 years, 1 month ago* (edited 27 minutes after) by daggerdragon to /r/adventofcode (134.8k)
679 commentsredditother-discussionssubreddit-indexmessage modsop-focus

NEW AND NOTEWORTHY

DO NOT POST SPOILERS IN THREAD TITLES!

  • The only exception is for `Help...

... view full text

4 years ago
—
4 years, 1 month ago
4 of 4

Tip Reveddit Real-Time can notify you when your content is removed.

your account history
(check your username's removed content. why?)
Tip Check if your account has any removed comments.
view my removed comments
you are viewing a single comment's thread.
view all comments
[–]ai_prof3 points4 years, 1 month ago* (edited 3 minutes after)

Python 3. Compact/readable/fast.

The whole "literal padding" thing caused loads of confusion. Once I realised it is a problem to be ignored, it's recursion to the rescue again (full code here). Code is short (1 line I/O and readable 27-line parse function with comments).

Returning the index for the next subpacket with the value of the current subpacket really simplifies things.

permalinkhide replies (2)author-focusas-ofpreserve
[–][deleted]3 points4 years, 1 month ago

You are so smart! Thanks for posting this! I was so stuck on how to do recursion on this. It turns out using the start index is the way to go! Thanks!

permalinkparentcontexthide replies (1)as-of
[–]ai_prof1 point4 years, 1 month ago

It started out much clunkier - with two types of counters in the arguments to the parse function. But I thought best to post the prettier, cleaner version :). Thanks for the compliment :)

permalinkparentcontextauthor-focusas-ofpreserve
[–]martino_vik2 points4 years ago

Python

This worked! Thx!

permalinkparentcontextauthor-focusas-ofpreserve
r/revedditremoved.substack.com
🚨 NEWS 🚨
✖︎

Important: Reddit Changed How Removals Work

A recent Reddit update makes mod-removed content disappear from profile pages, which breaks Reveddit's website.

Install the browser extension to receive removal alerts.

Add to chromeAdd to firefox

What changed?

r/revedditremoved.substack.com