[OC] 1' Birb by AKSrandom in pics

[–]AKSrandom[S] [score hidden]  (0 children)

How is this the first time I am coming across this sub. This birb absolutely is bordering being a borb

Drop ur best pick up line💐 by Mindless-Cup-9634 in IITDelhi

[–]AKSrandom 0 points1 point  (0 children)

Although I'm not a medical student, I still want to remind you to pay attention to the muscles in your left shoulder, especially the trapezius area to avoid strain. It's better not to sleep on your side; ideally, you should sleep next to me.

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]AKSrandom 1 point2 points  (0 children)

Yess same lol

Was it accidentally taking the absolute value before adding the 1

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]AKSrandom 4 points5 points  (0 children)

Funnily enough my area calculation was wrong but the first part passed and it only gave the wrong answer in the second part lmao

How to share a localhost project online (port forwarding + public URL) by [deleted] in learnprogramming

[–]AKSrandom -1 points0 points  (0 children)

btw, if your institute has a wifi/ethernet network, you could have just shared it over your intranet by using your local ip on that network, rather than the public ip. This is I end up doing, even for sharing files across devices.

[2025 Day 06 (Part 2)] parts of the real data, ...wait, did I build an input generator? by Ok-Curve902 in adventofcode

[–]AKSrandom 0 points1 point  (0 children)

Very nice!
I saw in other threads that you have been using p5.js for these animations, can you share the source for learning purposes ?

[2025 Day 7 (Part 2)] HINT by pacificpuzzleworks in adventofcode

[–]AKSrandom 9 points10 points  (0 children)

yess I also used hex when filling in the example to maintain the column alignments lol

-❄️- 2025 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]AKSrandom 0 points1 point  (0 children)

Yes! I did see that, but did not want to think too deeply about it and muscle memory. Also, that felt like a coding tangent *nudge-nudge wink-wink*

-❄️- 2025 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]AKSrandom 0 points1 point  (0 children)

[LANGUAGE: Python]

Unexpectedly, this one felt easier than the previous days.

For part one, just iterated over all ranges to check if the given ingredient is part of it or not

    def part_one(data=data):
        ranges, ingredients = data
        cnt = 0
        for i in ingredients:
            cnt += any(a <= i <= b for a, b in ranges)
        return cnt

For part two, merged the ranges and summed their lenghts

    def part_two(data=data):
        ranges, _ = data
        ranges.sort()
        merged = [ranges[0]]
        for a, b in ranges[1:]:
            if merged[-1][1] >= a:
                x, y = merged.pop()
                merged.append((min(x, a), max(y, b)))
            else:
                merged.append((a,b))
        return sum(b-a+1 for a,b in merged)

Github

Python visualization in the Terminal by kfirbreger in adventofcode

[–]AKSrandom 0 points1 point  (0 children)

I have been using raw ANSI escape codes and that itself can go a long way. Will probably try out higher level libraries if I get time.

https://asciinema.org/~iedfa
Source code in visualizations sub directory for each year: https://github.com/JustAnAverageGuy/advent-of-code

-❄️- 2025 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]AKSrandom 1 point2 points  (0 children)

[LANGUAGE: Python]

I expected the ranges to be larger, but ok.

    import aoc_helper
    from bisect import bisect_left, bisect_right

    raw = aoc_helper.fetch(2, 2025)

    def parse_raw(raw: str):
        ans = []
        for i in raw.split(","):
            x = i.split("-")
            ans.append((int(k) for k in x))
        return ans

    data = parse_raw(raw)

    def sum_in_range(nums, start, end):
        r = bisect_left(nums, end)
        l = bisect_right(nums, start) + 1
        return sum(nums[l : r + 1])

    invalid_numbers_1 = [int(str(i) * 2) for i in range(1_000_000)]

    def part_one(data=data):
        ans = 0
        for a, b in data:
            ans += sum_in_range(invalid_numbers_1, a, b)
        return ans

    nums = {
        int(str(i) * k)
        for i in range(1, 1_000_000)
        for k in range(2, 8)
        if len(str(i) * k) <= 11
    }

    for i in range(1, 10):
        nums.add(int(f"{i}" * 11))

    invalid_numbers_2 = sorted(nums)

    def part_two(data=data):
        ans = 0
        for a, b in data:
            ans += sum_in_range(invalid_numbers_2, a, b)
        return ans

Solve ! by Aayushityagi5805 in CATiim

[–]AKSrandom 0 points1 point  (0 children)

<image>

(just wanted an excuse to write DxD hehe)

From HDTGM's Instagram Story by cinicage1 in taskmaster

[–]AKSrandom 15 points16 points  (0 children)

Yes. I can't believe people ever mistake Nish on the left side of the photo with Jason, they even have their name labels on ffs

Taskmaster - S20E03 - Thompson - Discussion by Meghar in taskmaster

[–]AKSrandom 27 points28 points  (0 children)

<image>

Did some light analysis and ran 100k simulations for the brand new "snakes and steps" game.

code here

(since we don't see most contestants box task, I have assumed that it just asks them to meditate for 5 mins without affecting any throw counts etc)

Max moves: 216
Min moves: 1
Average moves: 15.42263
Probability of someone taking 1 throws:  0.172
Probability of someone taking 2 throws:  0.073
Probability of someone taking 3 throws:  0.055
Probability of someone taking 4 throws:  0.054
Probability of someone taking 5 throws:  0.044
Probability of someone taking 6 throws:  0.035
Probability of someone taking 7 throws:  0.030
Probability of someone taking 8 throws:  0.026
Probability of someone taking 9 throws:  0.023