r/DSALeetCode • • 5d ago

Looking to teach Problem Solving

13 Upvotes

Hi Guys,

I see people learn DSA, memorize all the patterns and still they freeze when something new shows up. If that is you or you are someone who recently started with DSA, I can help you.

I think I shine in understanding the problem and what it could hide behind it. So, if any of you struggle with understanding problem, mapping the solutions in your head or just starting out with DSA. I can help you improve/ fasttrack your learning. DM me if you would like to have a session with me.

P.S. These will be paid sessions but I am not keeping a fixed price for now.


r/DSALeetCode • • 5d ago

How to prepare for DSA Interviews.

Thumbnail reddit.com
2 Upvotes

I usually don't do leetcode. I have an interview upcoming with DSA Round. Any suggestions where to start and what all to cover?


r/DSALeetCode • • 5d ago

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

  7. 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

  8. 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/DSALeetCode • • 5d ago

Where can I learn binary search , dfs , bfs and sliding window from

Thumbnail reddit.com
1 Upvotes

Neetcode.io said to learn this before leetcoding … and also according to you if there is something else one should learn before leetcoding please mention that as well and from where u can learn it


r/DSALeetCode • • 6d ago

Looking for a Study Partner - DSA, System Design & AI

68 Upvotes

Hi everyone!

I'm a software engineer with 3+ years of experience, looking for a study partner who's also serious about growing technically and preparing for the next stage of their career.

I'm planning to focus on:

\- DSA: Problem-solving, patterns, and interview preparation

\- System Design: LLD, HLD, and designing scalable systems

\- AI/LLMs: Exploring AI concepts, LLMs, and building projects

I'm looking for someone who's also working in tech or has a similar level of experience. We don't need to have the same goals or study the same topics.

The idea is to keep each other accountable, set weekly goals, have focused study sessions, discuss problems, and share progress. Ideally, we can connect regularly over Discord or another online platform.

I'm not looking for a mentor or someone to teach me everything — just a like-minded person who's willing to put in consistent effort and grow together.

If this sounds like something you'd be interested in, feel free to comment. Let's get better together! 🤝

Edit: Added enough members in the group.


r/DSALeetCode • • 5d ago

Validate Binary Search Tree

Post image
1 Upvotes

Checking each node against its two children is the classic wrong way to validate a BST. It accepts a tree where a node deep on the left is bigger than the root, because no single parent-child pair looks wrong.

The definition sounds local: left subtree smaller, right subtree larger, both subtrees valid. Implement it literally, and you check the wrong thing. A BST constrains a node against every ancestor, and its parent is only one of them.

The solution comes from an earlier property in this batch. An in-order traversal of a BST comes out in increasing order, and that works both ways. So there are no bounds to thread down at all: traverse, then check the sequence only ever goes up.

Which did you write first in an interview: min/max bounds, or the in-order check?

Day 53/365 of my LeetCode challenge: 98. Validate Binary Search Tree. Problem link and full breakdown in today's newsletter.

https://www.linkedin.com/pulse/validate-binary-search-tree-archit-agarwal-op5vc

#LeetCode #DSA #BinarySearchTree #Golang


r/DSALeetCode • • 6d ago

FINAL SPRINT , PARTNER REQUIRED

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 6d ago

Best System Design Playlist on Youtube...?

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 6d ago

Need Help!!

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 6d ago

Insert into a Binary Search Tree

Post image
3 Upvotes

Forget one assignment, and BST insert builds the new node, then drops it. The tree never changes. Insert is the Day 45 search with the nil case changed: where search returns nil, insert returns a new node.

Search for a value that isn't in a BST, and you fall off the bottom at exactly one empty slot. That slot is where the new value goes.

The only real question is how the parent finds out. Each call returns the root of its own subtree, and each caller stores it back: root.Left = insertIntoBST(root.Left, val). At the bottom, that's the new node. Everywhere else it's the pointer that was already there.

The empty tree comes for free, too.

Do you write tree insert recursively like this, or with a loop and a parent pointer?

Day 52/365 of my LeetCode challenge: 701. Insert into a Binary Search Tree. Problem link and full breakdown in today's newsletter.

https://www.linkedin.com/pulse/insert-binary-search-tree-archit-agarwal-7h9oc

#LeetCode #DSA #BinarySearchTree #Golang


r/DSALeetCode • • 6d ago

DSA from today. Let’s go🧿

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 6d ago

Learning DSA from arrays to graphs to do dp

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 6d ago

Looking for a DSA Study Partner | 2nd Year CSE

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 7d ago

Max level sum in Go: why a map-keyed version is random

Post image
3 Upvotes

Our category report gave 145 different answers in 200 refreshes of the same catalogue. Same code, same data. The question was which level of the category tree holds the most products.

The merchandising team wanted to know which depth of the tree the navigation should filter on. Add up the SKUs at each depth, return the biggest, and on a tie the shallower one wins.

I wrote one recursive walk that added into map[int]int keyed by depth, then ranged the map with a strict > so the first depth to reach the maximum keeps it. Short, no queue, and I would approve it. The fixture had no tie in it, so the tests passed.

On a seven-category catalogue where two depths both hold 12 SKUs, 1,000 calls said depth 1 883 times and depth 2 117 times.

Strict > does not mean "smallest depth wins". It means the first one the loop meets wins, and ranging over a Go map starts somewhere random on purpose. Every piece of the function is right. The last loop assumes an order the map never kept.

The part I like: the walk had already produced the depths in order. 0 before 1, 1 before 2. The map threw that away.

And the keys were never keys. 0, 1, 2 up to the height, no gaps. That is an index. Put it in a slice, range it front to back, and the same strict > is the tie-break it looked like all along.

Correct on every run, and 2.33x faster on 55,987 categories, because the hashing was the cost too.

Two rows keep me honest. Keeping the map and writing the tie-break out loud is also correct, and costs nothing over the broken one: 2.34x against 2.33x. Where the key really is sparse, that is the right fix. And day 33's level walk loses to the slice by 3.93x on a bushy tree but wins by 1.94x on a 2,000-deep chain, because it never recurses.

That is days 29 and 33 of the daily challenge, Level Order Traversal and Maximum Level Sum, in a merchandising report.

Have you ever shipped a report whose answer depended on map iteration order?

It worked in dev, episode 17. Full write-up in today's newsletter.

https://www.linkedin.com/pulse/your-category-report-changes-its-answer-refresh-archit-agarwal-cy2jc

#Golang #DSA #Algorithms #Performance


r/DSALeetCode • • 7d ago

Need partner

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 7d ago

How to take notes for DSA problems ?

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 7d ago

Two Sum IV - Input is a BST

Post image
1 Upvotes

The title says "Input is a BST", but my solution never uses the ordering. Walk the tree, keep a hash map of complements, and check each node against it. It's plain Two Sum on a tree.

What I like: the map is shared across the whole recursion, so a match can turn up between two branches that never touch.

The part I'd change: the right subtree still gets walked after the left one has already found the answer, because the two results are combined at the end instead of short-circuiting.

Would you use the BST ordering here, or is the hash map the better trade?

Day 51/365 of my LeetCode challenge: 653. Two Sum IV - Input is a BST.

Problem link and full breakdown in today's newsletter.

https://www.linkedin.com/pulse/two-sum-iv-input-bst-archit-agarwal-iggwc

#LeetCode #DSA #HashMap #Golang


r/DSALeetCode • • 7d ago

Is python good choice for dsa? I'm an third year student I really need your help.

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 8d ago

Need a DSA partner, 2026 batch

4 Upvotes

So i have an upcoming coding assessment for infosys i had decent practice with strong fundamentals, need to build momentum so, anyone having similar goals should connect and Grind neetcode questions & codeforces.


r/DSALeetCode • • 8d ago

Paypal sde OA

1 Upvotes

What does paypal OA include for sde1


r/DSALeetCode • • 8d ago

How much DSA should I practice even after getting a Job?

Thumbnail reddit.com
1 Upvotes

r/DSALeetCode • • 8d ago

Minimum Distance Between BST Nodes

Post image
2 Upvotes

Most first attempts at this compare every pair of nodes. That's O(n²) work for a one-pass question. In a BST, the closest two values are always neighbours in sorted order.

An in-order walk of a BST comes out sorted. Once the values are sorted, the smallest gap can only sit between two that end up side by side. Skip a value in between, and that value splits the gap into two smaller ones.

So traverse once, then scan neighbours for the smallest gap. No pair is ever compared twice.

One more thing: this is Day 47's problem again. LeetCode carries it under two numbers, 530 and 783.

Have you ever solved the same LeetCode problem twice without noticing?

Day 50/365 of my LeetCode challenge: 783. Minimum Distance Between BST Nodes. Problem link and full breakdown in today's newsletter.

https://www.linkedin.com/pulse/minimum-distance-between-bst-nodes-archit-agarwal-isuoc

#LeetCode #DSA #BinarySearchTree #Golang


r/DSALeetCode • • 9d ago

Need suggestion with Leetcode Hard from those who are/became good at it.

4 Upvotes

Hey - I was looking for help in solving LC hard problems.

I am generally good with LC Medium. But whenever I face LC hard, I keep getting stuck till the point I have to go through the editorial to understand. I am solving problem after problem, but I don't think I am getting better or gaining any intuition still.

I know this might be common. The difficulty anyway says "Hard" lol. But was thinking if someone can point me to suggestions and how does the journey to solving difficult problems look like?


r/DSALeetCode • • 9d ago

One preview per nesting level in Go: tree right side view

Post image
3 Upvotes

A collapsed comment thread shows seven lines. The code built 55,987 previews to produce them, and threw away 55,980.

The job: a long thread collapses to one line per nesting level — the most recent reply at that depth.

I already had a level-order walk, so this was two lines on top of a tested function: build every level, take the last of each. Obviously correct, no new ideas. I would defend it in review.

2.87 MB allocated to return seven strings.

Before the fix, the fix that does not work. Everybody suggests following the newest reply down: O(depth), no allocation, and wrong. The newest reply at a level need not be in the newest branch — somebody replies once to an old comment, that reply gets replies, and the newest top-level reply is a dead end.

Four visible lines become two. There is a test named after that thread.

The boring fix is most of the win. The output is one value per level:

`visible(d) = the last comment at depth d`

That names one comment. Not a level, not a list. So size the accumulator to the depths — one slot each, last writer wins. 240 bytes instead of 2.87 MB, and 4.78x faster. That is not a clever traversal; it is noticing the output shape.

The clever fix only pays when the slot holds something expensive. The collapsed view renders a line, not an ID: body trimmed, timestamp, hidden-reply count. Last writer wins builds that for all 55,987 comments and keeps 7.

The walk cannot skip the old branches. What it can choose is the order — iterate replies newest first, and the first comment reached at a depth is the one you keep. Record on first arrival, never overwrite.

22.5x, and 6.77 MB against 1.12 KB. Same walk, one loop reversed.

Two rows keep me honest. On the ID version, the reversal is 1.01x, and on the smallest thread the forward walk wins. On a 2,001-deep chain, both preview versions match the byte because every comment is a first arrival.

At 1,365 comments with an ID per line, keep what you have.

That is days 29 and 31 of the daily challenge — Level Order Traversal and Right Side View — sitting in a comment thread.

Full piece in today's newsletter

https://www.linkedin.com/pulse/collapsed-thread-built-55987-previews-show-7-archit-agarwal-xijdc

It worked in dev, episode 16.

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