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
52
SOLUTION MEGATHREAD-🎄- 2019 Day 4 Solutions -🎄-(self.adventofcode)
submitted 6 years, 1 month ago* (edited 7 minutes after) by daggerdragon to /r/adventofcode (134.8k)
741 commentsredditother-discussionssubreddit-indexmessage modsop-focus

--- Day 4: Secure Container ---


Post your solution using /u/topaz2078's [paste](https://top...

... view full text

since 6 years, 1 month ago
5 of 5

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
[–][deleted]28 points6 years, 1 month ago

Regex

Part 1

^(?=[0-9]{6}$)(?=.*([0-9])\1)(?:0|1(?!0)|2(?![01])|3(?![0-2])|4(?![0-3])|5(?![0-4])|6(?![0-5])|7(?![0-6])|8(?![0-7])|9(?![0-8]))+$

Part 2

^(?=[0-9]{6}$)(?=(?:.*([0-9])(?!\1))?([0-9])\2(?!\2))(?:0|1(?!0)|2(?![01])|3(?![0-2])|4(?![0-3])|5(?![0-4])|6(?![0-5])|7(?![0-6])|8(?![0-7])|9(?![0-8]))+$

Matches valid passwords. I had to, sorry. Generate a list of integers in range, and count matches.

permalinkhide replies (2)as-of
[–][deleted]19 points6 years, 1 month ago

This is hate speech

permalinkparentcontextas-of
[–]repocin1 point6 years, 1 month ago

I'm not even going to attempt parsing that but I do wonder how you wrote that.

Like, where did you even begin?

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–][deleted]4 points6 years, 1 month ago

Some people did mention use of regex in their solutions, and I figured, hm, I think I could write the entire thing in regex (and because of https://www.xkcd.com/356/, I started working on it). I started with the part about digits never decreasing, and went down from here. I have used https://regex101.com/ to determine whether my regular expression works.

permalinkparentcontexthide replies (1)as-of
[–]repocin1 point6 years, 1 month ago

Alright, thanks. :)

I think that's pretty much how I would attempt to tackle it as well, but I certainly don't have as much patience as you do, lol.

Was mostly wondering if you had some 1337 trick up your sleeve. ;)

Dammit, now I kinda want to attempt doing this on my own...

Awesome work, btw!

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