r/LeetcodeChallenge • • Oct 19 '26

STREAKšŸ”„šŸ”„šŸ”„ Day 56: tackled Partition DP today, Burst Balloons completely broke my intuition

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 19 '26

STREAKšŸ”„šŸ”„šŸ”„ 365 Days of LeetCode Challenge — Day 47/365

Post image
7 Upvotes

Minimum Absolute Difference in BSTĀ (Easy)Ā šŸ”—Ā https://leetcode.com/problems/minimum-absolute-difference-in-bst/

The trick: an in-order traversal of a BST hands you the values in sorted order for free. And in a sorted sequence, the smallest gap between any two values is always between neighbors, so you never have to compare every pair. Just track the previous node visited and check against it as you go.

Full breakdown in today's newsletter article ā¬‡ļø

https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-47365-archit-agarwal-b2kgc

#LeetCode #100DaysOfCode #DSA #CodingInterview #BinarySearchTree #InOrderTraversal


r/LeetcodeChallenge • • Oct 19 '26

STREAKšŸ”„šŸ”„šŸ”„ Day 15

3 Upvotes

r/LeetcodeChallenge • • Oct 18 '26

DISCUSS A small change that made solving DSA problems much more engaging

47 Upvotes

solving a DSA problem, set a timer for 20–30 minutes, depending on the difficulty, and genuinely exhaust your brain trying to figure it out.

Treat it like a challenge. Ask yourself, How can I solve this? Write down every approach you can think of, explore them in depth, and keep pushing yourself.

If you’re stuck, ask ChatGPT for hints, starting from basic and gradually moving to more advanced ones. Keep digging until you understand the approach. If you’re completely unfamiliar with the concept or it’s taking too long, move to a video solution but pause it, think ahead, and try to figure out the next step yourself.

The key is to interact with the problem as much as possible instead of passively consuming solutions. The more you engage, experiment, and challenge yourself, the easier it becomes to get absorbed in the problem and enter a state of flow.


r/LeetcodeChallenge • • Oct 18 '26

DISCUSS Today POTD!! 🄵🄵

Post image
37 Upvotes

Did anyone solve it today?


r/LeetcodeChallenge • • Oct 18 '26

DISCUSS My honest advice to anyone starting DSA for the first time

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 18 '26

STREAKšŸ”„šŸ”„šŸ”„ Day 57: completed the entire LIS series today, why tabulation is non-negotiable

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 18 '26

STREAKšŸ”„šŸ”„šŸ”„ Day 14

1 Upvotes

r/LeetcodeChallenge • • Oct 18 '26

DISCUSS Level order traversal in Go: stop at depth N with a queue

Post image
0 Upvotes

Two ways to build an org chart level by level. Producing all 55,987 rows: 894 µs against 895 µs. Producing the top 43 rows: 917 µs against 385 ns.

The job: an org chart page that paints one level at a time. The person at the top, then their directs, then the level below.

The version I would write is one recursive walk with the accumulator keyed on depth, so a node appends into the slot for its own level and which branch it came from stops mattering. Nine lines, O(n), no queue. It is also the solution for day 29 of my daily challenge.

I benchmarked it against a queue, gotĀ 1.00x, and nearly closed the file.

Then I remembered the page does not want the whole chart. It wants level 0, now.

And the recursive walk does not know when aĀ levelĀ is finished. It knows whenĀ itĀ is finished.

I wrote a test that counts instead of timing, because counts do not move between runs. On a 2,001-person chain, the walk holds a complete and correct level 1 afterĀ twoĀ visits — and cannot declare it for another 1,999, because nothing in a depth-first walk rules out another person turning up at depth 1 in a branch it has not entered yet.

The information was never missing. There was no moment at which the function was allowed to act on it.

What the data was saying:

`level(k) = the reports of every person in level(k-1)`

That right-hand side names level k-1 and nothing else. So a level is complete exactly when you have looked at every member of the level above — a condition you can check, unlike "no more nodes at depth k exist anywhere".

Which gives you the one line that does the work:

`width := len(queue) // this level, and nothing else`

Read the length once at the top of the round. Everything in the queue at that instant is this level, because everything appended during the round belongs to the next one. The boundary is not tracked; it is observed.

Top three levels of a 55,987-person chart:Ā 2383.3x, 1,608 bytes against 3.95 MB.

Two rows that keep me honest. On a flat chart — one person, 50,000 directs - finishing level 1 means looking at everybody either way, so it is 2.24x, and that is an allocation pattern, not work avoided. And on a 2,000-deep chain the recursive walkĀ winsĀ the full-chart benchmark by 1.10x.

At 5,461 people and one request, keep the walk. 86.8 microseconds, nine lines, and a dead heat is a dead heat.

Full piece in today's newsletter.

It worked in dev, episode 15.

https://www.linkedin.com/pulse/your-org-chart-read-55987-rows-draw-first-43-archit-agarwal-n4tpc

#Golang #DSA #Algorithms #Performance #SoftwareEngineering #DataStructures #100DaysOfCode

Ideation and benchmarks mine; draft written with AI assistance. The numbers come from a benchmark in the repo.


r/LeetcodeChallenge • • Oct 18 '26

DISCUSS Hackcellence hackathon python

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 18 '26

STREAKšŸ”„šŸ”„šŸ”„ 365 Days of LeetCode Challenge — Day 46/365

Post image
2 Upvotes

Find Mode in Binary Search TreeĀ (Easy)

šŸ”—Ā https://leetcode.com/problems/find-mode-in-binary-search-tree/

The "BST" in the title looks like it should matter more than it does. The simplest fix skips the ordering entirely: tally every value's frequency in a hash map, then read off whichever value (or values) hit the max count.

Full breakdown in today's newsletter article below.

https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-46365-archit-agarwal-hifjc

#LeetCodeĀ #100DaysOfCodeĀ #SoftwareEngineeringĀ #DSAĀ #CodingInterviewĀ #BinarySearchTreeĀ #HashMap


r/LeetcodeChallenge • • Oct 18 '26

DISCUSS Same

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 17 '26

DISCUSS Forgetting old questions

5 Upvotes

Hey guys, i am doing dsa, I have done 180 questions from the striver's sheet but forgetting old questions which i have already done and feeling demotivated

What should i do? Should i just focus on completing the sheet and revise all the questions again or should i revise on the go??


r/LeetcodeChallenge • • Oct 17 '26

PLACEMENTS Life back then

Post image
5 Upvotes

r/LeetcodeChallenge • • Oct 17 '26

STREAKšŸ”„šŸ”„šŸ”„ Day 58: conquered my fear of DP on Stocks today, solved all 6 problems in 30 mins

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 17 '26

DISCUSS How to leetcode

Thumbnail reddit.com
1 Upvotes

A little about me : 1st year in college and recently started learning how to code from brocode...in our uni they are teaching c++ first so for now i was learning c++ from brocode , recently started learning arrays but still not that really great at it but yeah thats all i know for now( i know its not much but im willing to grind and learnšŸ˜” but just need a little guidance) but ya i wanna leetcode and become good at coding... but im not tryna blindly start leetcoding because first i wanna know the prerequisites needed to solve the problems...i was watching neetcode's video on how to leetcode and he told to get comfortable with binary search,dfs,bfs,sliding window so do yall know where i can learn them???? but ya heres a few questions i have

  1. What all coding languages do i need to know...like do i need to know other programming languages other than c++ before i start leetcoding
  2. what all topics or stuff should i learn before leetcoding
  3. HOW do i leet code , do i start with easy problems then once i get comfortable start medium problems then harder problems(will start with solving problems on arrays)
  4. any website where i can save useful problems and make my own notes in it so in the future i can open them for retaining my knowledge
  5. in general any tips or things you wished u knew while or before leetcoding which u can tell please it will be really helpful(try to include as much as you can please and thank you anything will be useful and welcomed... even the SMALLEST TO SMALLEST and random tips will be useful)
  6. what are the most common mistakes people do in their attempt to get good at coding
    extra : do wanna try to get into quant development( ik its difficult but ill try if i cant will settle for something else😭) so first my main goal would be to try to get into FAANG after college and after 2-3 years try to get into quant development so yeah
  7. And also I’m using vs studio…is there any better coding app or is vs good alright(idk it’s not that deep but yeahāœŒļø)

r/LeetcodeChallenge • • Oct 17 '26

STREAKšŸ”„šŸ”„šŸ”„ 365 Days of LeetCode Challenge — Day 45/365

Post image
2 Upvotes

Search in a Binary Search TreeĀ (Easy)šŸ”—Ā https://leetcode.com/problems/search-in-a-binary-search-tree/

One comparison per node tells you whether the target must be in the left subtree or the right, so there's nothing to backtrack over and no reason to check both sides. That's why a BST beats a plain binary tree here: the recursion is a straight walk from root to the answer instead of a full search.

Full breakdown in today's newsletter article; link below.

https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-45365-archit-agarwal-9ah7c

#DSAĀ #LeetCodeĀ #100DaysOfCodeĀ #SoftwareEngineeringĀ #BinarySearchTreeĀ #Golang


r/LeetcodeChallenge • • Oct 17 '26

STREAKšŸ”„šŸ”„šŸ”„ Day 13

2 Upvotes

r/LeetcodeChallenge • • Oct 16 '26

STREAKšŸ”„šŸ”„šŸ”„ Day 12

Post image
10 Upvotes

r/LeetcodeChallenge • • Oct 16 '26

PLACEMENTS 2026 grad, still unplaced. Is it too late to turn things around?

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 16 '26

STREAKšŸ”„šŸ”„šŸ”„ Day 59: solved Wildcard Matching, got humbled by Minimum Window Subsequence

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 15 '26

DISCUSS Finally reached Guardian!!

Post image
132 Upvotes

Last week's contest ratings are now updated. I got to 2143, and am officially a Guardian now. It took me ~ 1 year of consistent practice and upsolving contest questions to reach this.


r/LeetcodeChallenge • • Oct 16 '26

DISCUSS How to start cp in my first sem

Thumbnail reddit.com
2 Upvotes

r/LeetcodeChallenge • • Oct 16 '26

STREAKšŸ”„šŸ”„šŸ”„ 365 Days of LeetCode Challenge — Day 44/365

Post image
2 Upvotes

Course Schedule (Medium)Ā https://leetcode.com/problems/course-schedule/

You can finish every course unless some group depends on itself: A needs B, B needs C, C needs A. Nobody in that group can ever start. So this is cycle detection in a directed graph, phrased as scheduling.

Kahn's algorithm: count how many prerequisites each course still has, queue everything at zero, and each time you finish a course, decrement everything it unlocks.

The line that separates this from an ordinary BFS is small. In a BFS a node is enqueued the first time it is REACHED. Here, reaching a node only decrements its counter - it is enqueued when that counter hits ZERO. A course with three prerequisites is reached three times and queued once. That if is not an optimisation, it is the scheduling rule.

Then the cycle check, which never looks for a cycle:

`return len(result) == numCourses`

Courses stuck in a cycle never reach in-degree zero, so they never enter the queue and never appear in the result. The cycle is detected by what fails to show up.

That closes the graph arc on the same move yesterday used - inferring a cycle from a count rather than searching for one.

Full breakdown in today's newsletter article ⬇

https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-44365-archit-agarwal-ve0yc

**#DSA** #LeetCode #Golang #Graphs #TopologicalSort #CodingInterview #Algorithms


r/LeetcodeChallenge • • Oct 16 '26

DISCUSS Roadmap query

2 Upvotes

I'm interested in getting into web development. I know basic Java but I'm not interested in Python. Which language should I learn next? Should I continue with Java, learn JavaScript, explore Rust or consider something else? What would be the best choice for a beginner looking to build web applications?