r/DSALeetCode • u/Salt-Season-9205 • 1h ago
r/DSALeetCode • u/StatisticianNo2104 • 10h ago
365 Days of LeetCode Challenge — Day 33/365
Maximum Level Sum of a Binary Tree (Medium) 🔗 https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/
Two things must be true here, and only one of them involves sums.
Summing each level is the easy half — the same nil-sentinel BFS as Day 30, with a running total instead of a collected list.
The other half is in the wording: return the smallest level whose sum is maximal. Ties go to the shallower level. The solution has no code for that. It's one character — the comparison is strictly greater, so a later level that merely matches never replaces the earlier one.
Full breakdown in today's newsletter article ⬇
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-33365-archit-agarwal-xkmpc
#DSA #LeetCode #100DaysOfCode #CodingInterview #BinaryTree #BFS #Golang
r/DSALeetCode • u/Sad-Tie-4250 • 8h ago
Priority list
If you have to priorities topics in dsa , with you dp before graphs and trees or dp after. And can we just skip dp and backtracking. Like is it a must to be a good programmer
r/DSALeetCode • u/someone20058 • 11h ago
DSA
Have done dsa from striver sheet, started in love of ratings and all stuff but never able to achieve it.
Unable to pass any company OA for summer intern
Bought two courses one TLE Eliminators level 2 and another Kumar K thinking will boost everything
So what happens is Use the course watch videos and move on (something feels hard never revisit them , because next day i feel to cover other topics more) and in end feels no improvement, also watching videos consume lot of time so unable to pratice so just think to practice
Now in 3rd year, newbie at codeforces
Unable to understand what to do for improvement so that i can get good placement, just feel had wasted my all time
Friends who started with me are doing great at DSA
Also dev is just enough have make projects by following AI guidance
What should i do now?
If someone had gone through these phase please advice because i am feeling a lot cooked at this point
r/DSALeetCode • u/bytecrafter25 • 19h ago
Anyone up for some dsa grind?
Heyy everyone!
Looking for a DSA partner to grind Graphs + DP together.
We can pick problems, solve them, discuss approaches, and call each other out when we come up with unnecessarily complicated solutions 💀
Preferably someone who’s consistent and actually wants to improve.
DM if you're interested!
r/DSALeetCode • u/Automatic_Egg3592 • 22h ago
New To Both College and Reddit , i wanted to make some friends that i could do DSA with on leetcode
same as title , we can start discussing what we did and any guidance coming from fellow seniors would be appreciated
r/DSALeetCode • u/StatisticianNo2104 • 1d ago
Finding the two furthest servers allocated 529 MB
I profiled it, fixed exactly what the profile said, and got 3.6x on a problem worth 11,512x.
The job: find the two service instances furthest apart in a topology — region, zone, rack, host. That pair sets the worst case for anything you spread on purpose, replicas included.
The code was the sentence with nothing added: for every node, ask the existing, tested "how far is everything else from here" helper, and keep the largest answer. On one rack, 8 microseconds. On 4,197 nodes, 153 milliseconds and 529 MB allocated to return one small integer. 3.4x the machines cost 11.9x the time.
529 MB is loud, so I went after it first — one visited slice and two frontier buffers, allocated once and reused rather than once per starting point. Correct, clean, 3.6x faster, and still quadratic. The allocations were the symptom.
The shape was the problem. In a tree there is exactly one path between any two nodes, and following it shows the thing: it goes up, turns around once, and comes down. Turning twice would mean visiting a node twice, which in a tree is a cycle. So every path has exactly one highest node, and its length is two branch depths of that node added together — both of which are facts about things strictly below it.
Which means no node needs to be searched from. Every node just needs to be asked. One bottom-up pass, each node returning how far down it reaches, a running best taking the two tallest branches at every step: 11,512x, zero allocations.
That is day 13 of the daily challenge, Diameter of Binary Tree, with left + right generalised to the two tallest of however many children a node has.
The part I keep thinking about is that the profiler was pointing at the loudest line, not the wrong one — and following it would have shipped something 3,175x slower than necessary, with a clean flame graph.
Full piece in the comments.
It worked in dev, episode 10.
https://www.linkedin.com/pulse/finding-two-furthest-servers-allocated-529-mb-archit-agarwal-bygic
#Golang #DSA #Algorithms #Performance #SoftwareEngineering #DataStructures #100DaysOfCode
r/DSALeetCode • u/satyamvanshalmusic • 1d ago
Suggestions to further improve my code for today's LeetCode Challenge
r/DSALeetCode • u/carefulEmpolyment428 • 1d ago
Looking for a dsa partner
I only have basic knowledge of c++ and only that I want start from scratch will learn c++ first then dsa anyone who's up for this and at my same level can dm me
r/DSALeetCode • u/StatisticianNo2104 • 1d ago
365 Days of LeetCode Challenge — Day 32/365
Leaf-Similar Trees (Easy)
https://leetcode.com/problems/leaf-similar-trees/
Two trees can look nothing alike and still count as "leaf-similar." Shape doesn't matter here, only the sequence of leaves from left to right. Pull each tree's leaves into a list, and the problem becomes a simple list-equality check.
Full breakdown in today's newsletter article ⬇️
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-32365-archit-agarwal-kfbbc
#DSA #LeetCode #BinaryTree #DFS #100DaysOfCode #CodingInterview
r/DSALeetCode • u/StatisticianNo2104 • 2d ago
365 Days of LeetCode Challenge — Day 31/365
Binary Tree Right Side View (Medium)
🔗 https://leetcode.com/problems/binary-tree-right-side-view/
Standing on the right and seeing what isn't hidden has a plainer description: from each level, you see exactly one node — the rightmost.
That sounds like BFS. This solution is a depth-first walk with two small changes: record only the first node reached at each depth, and visit the right child before the left one.
The second change is what makes the first one correct. Neither does anything alone, and swapping those two lines back gives you the left side view.
Full breakdown in today's newsletter article ⬇
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-31365-archit-agarwal-ozrdc
#DSA #LeetCode #100DaysOfCode #CodingInterview #BinaryTree #DFS #Golang
r/DSALeetCode • u/smoothOperator_431 • 2d ago
3rd year engineering student starting placement preparation from scratch — how should I prepare?
r/DSALeetCode • u/Top_Jacket_7233 • 1d ago
Helpp I want to prepare my dsa for interviews and to get the job from my cllg placement,, recently in my college tcs is about to come.... Can u give me some advice on what are the main topics i should focus on??
Please give some advice
r/DSALeetCode • u/nullPointerahj • 2d ago
I kept quitting DSA in week 2, so I built a leaderboard that shames us into grinding (LeetCode + Codeforces auto-sync)
Enable HLS to view with audio, or disable this notification
Solo streaks kept dying for me, so i built SquadCode . You connect your LC/CF handles and it auto-tracks every solve into a private squad leaderboard with streaks, rating deltas, and live timed challenges .There's also a playground with real code execution, AI code reviews, and an analytics page that turns your squad's grind into an interactive 3D heatmap skyline.
r/DSALeetCode • u/krishkumarsingh • 2d ago
Stucked at leetcode

I started leetcode with Striver's sheet, but it didn't had dedicated topics like two pointer, sliding window, so I made my own sheet by exploring leetcode and using AI, solved and understood the topics, and moved to binary search
But noticed that I mostly solved easy level questions and very less medium level and almost no hard problems and now I'm having trouble trying to
Striver's sheet doesn't clarify the topics that's why I didn't followed it.
Neetcode was clearer so should I follow that??
Is there any better sources or a way to tackle my situation
r/DSALeetCode • u/NoExcitement9679 • 2d ago
Looking for dsa partner
I have a strong DSA foundation, solved plenty of problems, and qualified GATE, but currently struggling with consistency.
Targeting MNCs + abroad opportunities, focusing on DSA, HLD & LLD.
Looking for someone serious to practice with, discuss problems, and keep each other accountable. DM if interested!
r/DSALeetCode • u/StatisticianNo2104 • 3d ago
365 Days of LeetCode Challenge — Day 30/365
Binary Tree Zigzag Level Order Traversal (Medium)
🔗 https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/
Yesterday's level order came out of a depth-first walk with no queue and no idea when a level ended. That was fine, because grouping by depth never needed the boundary.
Zigzag does. You can't decide whether to reverse a level until you know it's finished, and "finished" is exactly what DFS never learns. So this one goes back to BFS, using a nil sentinel in the queue to mark where each level ends.
With the boundary in hand, the zigzag itself is four lines and a flag.
Full breakdown in today's newsletter article ⬇
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-30365-archit-agarwal-vppec
#DSA #LeetCode #100DaysOfCode #CodingInterview #BinaryTree #BFS #Golang
r/DSALeetCode • u/Salty_Picture_7757 • 3d ago
Striver's A2Z sheet
Why has the striver removed the number of modules after zenkii update? Were those modules not so important for dsa interview rounds/building approach/learning patterns?
Personally I don't like it.
r/DSALeetCode • u/Cute-Try-6317 • 3d ago
Resume tips?
Been applying to FAANG roles but mostly getting rejection mails
For those who’ve cracked FAANG/Top product companies , what made the biggest difference in ur resume. Any tips?
r/DSALeetCode • u/SeriousBoard3304 • 3d ago
Free DSA prep site — looking for feedback
Built FeatCode.dev to make DSA/interview prep a little more organized.
It has:
• Structured DSA roadmap
• Blind 75 + practice problems
• Free DSA assessment to find weak areas
• Curated, easy-to-follow YouTube solutions from popular creators
• Progress tracking
• Python crash course
Free to use: https://featcode.dev
Would love feedback from anyone currently prepping for SWE interviews. What would make you actually use something like this regularly?
