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
125
SOLUTION MEGATHREAD-❄️- 2024 Day 1 Solutions -❄️-(self.adventofcode)
submitted 1 year, 1 month ago* (edited 1 day, 1 hour after) by daggerdragon to /r/adventofcode (134.8k)
1399 commentsredditother-discussionssubreddit-indexmessage modsop-focus

It's that time of year again for tearing your hair out over your code holiday programming joy an...

... view full text

since 1 year, 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]3 points1 year, 1 month ago* (edited 1 year after)
[deleted] by user
(check your username's removed content. why?)
hide replies (1)as-of
[–]gzipgrep2 points1 year, 1 month ago

Your answer inspired me to try using SQLite. :-)

create table input (line);
.import 1.txt input
create table left as select substr(line, 0, 6) as l from input order by l;
create table right as select substr(line, -5) as r from input order by r;
select sum(abs(l-r)) from left join right on left.rowid = right.rowid;
select sum(score) from (select r*count(r) as score from right where r in left group by r);
permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]vmaskmovps1 point1 year, 1 month ago

Wait, you can use .import in scripts? I feel dumb now 😭

Much cleaner than my CTE-based solution, at least at a first glance

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]gzipgrep2 points1 year, 1 month ago

Looking it up, it seems you can so long as you're using the sqlite3 program (which, well, I am).

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]vmaskmovps1 point1 year, 1 month ago

I'm aware of that, I didn't know if you had to use it from within the shell

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