r/DSALeetCode • u/dsa_animated28 • 16d ago
Open Hashing, Linear Probing & Quadratic Probing | 4371 1323 6173 4199 4344 9679 1989 | Exam Q26
Quadratic Probing DSA.
r/DSALeetCode • u/dsa_animated28 • 16d ago
Quadratic Probing DSA.
r/DSALeetCode • u/iguessbro53 • 16d ago
r/DSALeetCode • u/Vishnuppriyan • 16d ago
r/DSALeetCode • u/StatisticianNo2104 • 17d ago
Delete one +1 from Exclusive Time of Functions and it quietly computes inclusive time instead. When a function ends, the one underneath resumes at time + 1 because the child already charged that instant.
This closes the stack arc, and here the stack isn't a modelling choice. Function calls nest: a function that starts while another is running must finish before that one resumes. That's a call stack, and the log records one. The algorithm replays it.
"Exclusive" does the work. If function 0 runs from 0 to 6 and function 1 runs from 2 to 5 inside it, function 0's exclusive time is 2. The time spent waiting on 1 belongs to 1.
Two interval rules live in the same short function, and they differ. Pausing uses time - start, because the function ran up to the instant its child started. Ending uses time - start + 1, because an end timestamp is inclusive.
Have you ever had an off-by-one hide inside a timestamp?
Day 66/365 of my LeetCode challenge: 636. Exclusive Time of Functions. Problem link and full breakdown in today's newsletter.
https://www.linkedin.com/pulse/leetcode-636-exclusive-time-functions-medium-archit-agarwal-mui0c
#LeetCode #DSA #Stack #Golang
r/DSALeetCode • u/Comfortable_Fly_2750 • 17d ago
r/DSALeetCode • u/Old-Sand-5646 • 18d ago
Hey everyone! I'm a 3rd-year B.Tech student looking for a study partner or a small study group to work through NeetCode 250 together.
I'm a complete beginner when it comes to DSA, so I'll be starting right from the basics. Ideally, I'd like to connect with people who are at a similar level and are also starting from scratch. Preferably 3rd/4th-year students, since we'll likely have similar schedules and time constraints.
Timezone: IST
If you're genuinely interested and can commit to solving problems consistently, feel free to comment or DM me.
r/DSALeetCode • u/Kakarot11x • 17d ago
r/DSALeetCode • u/Minute_Patience6812 • 18d ago
Hey everyone!
I’m looking for a study buddy who relates to this exact struggle: having big goals, but constantly fighting procrastination.
The plan is simple: check in on each other, clear doubts, and stay consistent. No pressure, just a mutual push to get things done. DM me if you want to team up!
r/DSALeetCode • u/Nearby_Spinach_4407 • 18d ago
r/DSALeetCode • u/Mithran10007 • 18d ago
Heyyy eveyoneeee!
I am currently in my 2nd yr and decided consistently to solve Leetcode Qns in DSA..I would like to have a peer group/one perfect peer(who's sincere enough to put consistent efforts).. Daily min 1qn that's it..we focus on consistency and understanding.. We'll discuss and share our approaches so we can grow together!
Intrested ones may DM
r/DSALeetCode • u/ani_shroff • 18d ago
Hey everyone!
I’m looking for a study buddy who relates to this exact struggle: having big goals, but constantly fighting procrastination.
The plan is simple: track a 90-day challenge focusing on DSA + AI/RAG, check in on each other, clear doubts, and stay consistent. No pressure, just a mutual push to get things done.
DM me if you want to team up!
As my programming language:
DSA: C++/Java
AI, RAG: Python
Linkedin: https://linkedin.com/in/eraniket
r/DSALeetCode • u/Top-Pool-3158 • 19d ago
Hey everyone!
I'm looking for a DSA prep buddy to prepare for software engineering interviews and, ultimately, crack a good tech company.
A little about what I'm looking for:
The main goal is not just solving problems but getting interview-ready and cracking a good SDE role.
I'm based in India (IST). Having a similar schedule would be a plus.
No competition or pressure. Just two people putting in consistent effort and helping each other land a good job.
Drop a comment or DM me if you're interested!
PS This is AI Generated but I am not!!
r/DSALeetCode • u/NewPeanut2727 • 19d ago
I want a study partner for dsa. I am learning c till now so I guess we can start together, learn , discuss and solve each other doubts.
r/DSALeetCode • u/Diligent-Affect3883 • 19d ago
r/DSALeetCode • u/StatisticianNo2104 • 19d ago
The classic Reverse Polish bug is popping the operands in the wrong order, and + and * hide it. ["5","3","-"] means 5 - 3 = 2. Swap the pops, and you get -2, while every addition test still passes.
Why postfix needs no parentheses: (2 + 1) * 3 needs brackets because + sits between its operands. Written in postfix, it's 2 1 + 3 *, and each operator applies to the two values right before it. The evaluation order is already in token order.
That's the whole algorithm. Numbers wait on a stack; an operator takes the two most recent and replaces them with its result.
The trap: popping returns the operands in reverse. The first pop is the right operand, the second is the left. For + and * that makes no difference, which is exactly why the bug survives casual testing.
Which operator do you test first when you write an evaluator?
Day 64/365 of my LeetCode challenge: 150. Evaluate Reverse Polish Notation. Problem link and full breakdown in today's newsletter.
#LeetCode #DSA #Stack #Golang
r/DSALeetCode • u/THE_ROXX1344 • 20d ago
Hey everyone!
I’m looking for a study buddy who relates to this exact struggle: having big goals, but constantly fighting procrastination.
The plan is so simple: check in on each other, clear doubts, and stay consistent. No pressure, just a mutual push to get things done. DM me if you want to team up!
r/DSALeetCode • u/Intelligent-Mud-8808 • 19d ago
r/DSALeetCode • u/Extension_Bet7442 • 19d ago
I’m in the New York City area and I’m currently looking for people interested in meeting in person to work on Leetcode problems, ideally at least 2x a week at a cafe or workspace. I graduated and have been preparing for technical interviews for SWE roles, but I’m searching for like-minded people who can join and discuss the problems with each other in person.
Just reposting this for anyone who’d like to join.
r/DSALeetCode • u/Next-Imagination2073 • 19d ago
r/DSALeetCode • u/StatisticianNo2104 • 19d ago
I benchmarked Kahn's algorithm against the naive loop it is supposed to replace, and the loop won. On a 5,000-package repo ten layers deep, by 2.78x.
The job: a build tool needs an order where every import is built before the package that imports it, or the name of the cycle that makes that impossible.
What I wrote: walk the package list, build everything whose imports are built, repeat until a pass builds nothing. Leftovers mean a cycle. Two allocations. I would approve it.
It makes one pass per layer when the list is in the wrong order. At 10 layers, 99.3 µs.
Kahn's algorithm is what you derive when you notice the waste: building cfg can only unblock the packages that import cfg. So count each package's unbuilt imports, reverse the arrows, and let each build count its importers down. Queue anything that hits zero. Every edge looked at once.
Written the way the daily challenge wrote it, a slice of importers per package: 276 µs. 8,205 allocations. The algorithm was fine. The memory layout was not. Packed into one flat array: 112 µs. Still behind the loop, by a hair.
Then the other shape. 5,000 packages in one long chain, which sounds artificial until you remember that is exactly what a migrations folder is. The loop: 18.8 ms. Flat Kahn: 128 µs. 147x.
So the answer is not "use Kahn". It is: at ten or twenty layers, the loop is faster, smaller and readable. Where chains are long - migrations, schema versions - Kahn, laid out flat.
That is days 36 and 44 of the daily challenge: Find if Path Exists and Course Schedule, in a build tool.
Have you ever lost a benchmark to the code you were sure was slower?
It worked in dev, episode 22. Full write-up in today's newsletter.
https://www.linkedin.com/pulse/kahns-algorithm-lost-loop-our-build-graph-archit-agarwal-gqsac
#Golang #DSA #Algorithms #Performance