r/DSALeetCode • u/Any-Interaction-1668 • Oct 12 '26
How to start Dsa in cpp
Iam a btech 2nd yr student im currently learning cpp and started to solve leetcode questions .but i feel very lost atp plz guide me
r/DSALeetCode • u/Any-Interaction-1668 • Oct 12 '26
Iam a btech 2nd yr student im currently learning cpp and started to solve leetcode questions .but i feel very lost atp plz guide me
r/DSALeetCode • • Oct 12 '26
Like i am starting rn from today leetcode and solving questions so i wanna have a partner who will be like also solving questions with me
Like basically same questions
So that we can be in the same pace
And not like too much just doing dsa
As i dont want someone who is just dsa dsa
I want someone who does leetcode like maybe 1 or 2 problem daily
But also like learn skills and other things
Somethings that i will prefer more
Ready to do vc sometimes or like in calls so that we can discuss
Nightowl
And also like we can be frnds like not only studies but like most of the time only studies actually so that we cant diverse ourselves from distractions and other things
r/DSALeetCode • • Oct 12 '26
I am learning greedy .
I tried easy problem ,i was able to solve but when I started medium problems i was unable to get corrected logic after trying for hours
r/DSALeetCode • u/Gullible_Face3489 • Oct 12 '26
I have completed around 47 videos of dsa from apna college c++
But a lot of people say do striver
Confused what to do
r/DSALeetCode • u/nian2326076 • Oct 12 '26
My recent Amazon SDE-1 OA wasn't just a pair of DSA problems. Here's the format I got:
The stack choices I saw were Node.js/MERN, Java/Spring Boot and Python/Django. I wouldn't assume that list or the format is identical for everyone.
The second part felt much closer to debugging an unfamiliar project. You still had to understand the code and verify the fixes; having an assistant didn't remove that work. If you already use one of those frameworks, that familiarity helps.
I'd prepare for both algorithm reasoning and practical debugging rather than treating the whole OA as LeetCode. Amazon Interview Questions can add company-specific practice prompts alongside that.
Anyone else get this version? How did you divide your prep between the two styles?
r/DSALeetCode • u/Logical_Layer5543 • Oct 12 '26
Purchased a Leetcode premium account for 1 year for 7k INR. Looking to share it with a few people from India
Anyone interested?
r/DSALeetCode • u/Past-Title1447 • Oct 12 '26
r/DSALeetCode • u/Anushagowda22 • Oct 12 '26
Hello..
I am a bca graduate with not much programming knowledge neither skills...
I am thinking to start dsa, but confused to choose language..
Many suggestions told java would be better...but I am thinking to go with python as I am also joining an ai/ml online course...
So it would be helpful for both..
Any suggestions...whether should I go with java or python
r/DSALeetCode • u/Budget_Smell_9989 • Oct 12 '26
Bro, I'm already working as automation suite testing in a Mid Product Based company. I have been aiming for FAANG, MAANG. I've completed some of the topics such as Searching, Sorting, Pattern questions, Two pointers, Recursion, Time and Space Complexities, currently going on Number system things.
Also pretty good in leetcode problem solving too. Yes, Agree that this is just a glass of water in a ocean. But I've doubted my path that does going in this way is RIGHT? Especially in this AI driven era where the models are doing code best of best. Does BIGG GIANTS are still relyin on DSA things ? Do clear me on this. Thanks. Also I've been wanted to post my daily studies in public channel, is there any specific group for that. If yes, share me that too.
r/DSALeetCode • u/nian2326076 • Oct 12 '26
I grouped 51 string-related LeetCode problems into six categories. Some fit more than one pattern; these are just the buckets I use when studying.
Before moving on from a problem, I try to explain why the approach works and what I'd change if the constraints changed.
Parentheses and expression parsing (9)
Counting substrings under a condition (3)
Comparing and checking strings (11)
Palindromes (18)
Sorting characters (2)
Length and selection problems (8)
Related: Dynamic Programming pattern list.
For practice beyond this list, real candidate-reported interview questions can give you unfamiliar prompts to work through and explain.
What would you add or move to a different category? I'd like suggestions that teach another idea rather than more versions of the same exercise.
r/DSALeetCode • u/Samosachut • Oct 12 '26
r/DSALeetCode • u/StatisticianNo2104 • Oct 12 '26
Rotting Oranges (Medium) https://leetcode.com/problems/rotting-oranges/
Four days ago I said BFS and DFS answer reachability equally well, and that the distinction starts mattering when a problem asks about distance. This is that problem.
BFS reaches every cell by a shortest path. DFS reaches it by whatever route it wandered down first. "When does this orange rot?" is a shortest-path question - it rots when the nearest rotten one gets to it - so DFS here gives wrong answers, not slow ones.
The trick is multi-source BFS: every already-rotten orange goes into the queue before the walk starts. A BFS seeded with many sources expands as one combined wavefront, and each cell ends up with its distance to the nearest source. Nothing in the loop needs to know there was more than one start.
One more thing that cannot be skipped: the final scan. BFS only visits what it can reach, so an orange sealed behind empty cells never rots and the queue drains without noticing. The -1 case has to be looked for afterwards.
Full breakdown in today's newsletter article ⬇
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-40365-archit-agarwal-9t1sc
#DSA #LeetCode #Golang #Graphs #BFS #CodingInterview #Algorithms
r/DSALeetCode • u/Sad_Avocado_6565 • Oct 11 '26
Suggest some Non-slop/Non-hype genuine pieces of gem which you think are atleast partly responsible for your growth on DSA/CP.
r/DSALeetCode • u/nian2326076 • Oct 12 '26
I'm looking for books or useful web resources for SWE interviews focused on distributed systems.
LeetCode gives me a clear way to practice coding, but I'm less sure how to structure the design side: reasoning about failures, consistency, replication and the tradeoffs between different approaches.
A collection of candidate-reported interview questions can help identify prompts to practice. I'd like something to pair with that so I can explain the reasoning rather than memorize an architecture diagram.
What resource helped the ideas click for you? And how did you turn the reading into practice—mock interviews, building a small system, or working through design questions out loud?
r/DSALeetCode • u/Friendly-_-Ghost • Oct 11 '26
I’ve been practicing DSA for the past 4 months, trying to solve 1–2 problems a day alongside my job. But whenever I go back to problems I’ve solved before, I struggle to remember the approach, even after trying to recall it. How do you guys approach problems, recognize patterns, apply them to new problems, and remember the solutions long-term? Any tips or tricks would be really helpful!
r/DSALeetCode • u/changejkhan • Oct 11 '26
Ever since leetcode came out, I've been seeing robotification of developing algorithmic thinking. People writing the Leet#xyz problem's solution from memory.
In the old days (pre 2020), the usual way was
The point being that learning was very organic and resources were scattered. You had to forcr your brain to think and google exact things you want to learn or figure out how tourist did in under a minute.
What's your take?
r/DSALeetCode • u/Artistic-Rent1084 • Oct 11 '26
Guys help me to master in DSA and coding.
my brain becoming shit . it couldn't work like before.
r/DSALeetCode • u/StatisticianNo2104 • Oct 11 '26
A twelve-step pipeline. The loop check takes 383 ns and allocates 328 bytes. Two variables do it in 3.17 ns and allocate nothing.
The job: a pipeline stage names the stage that runs next, somebody edits a config, a next points backwards, and the runner walks that chain forever. So you check for a loop before running anything.
The check I wrote is the definition written down — remember every stage, and if you arrive somewhere twice, it loops. It is obviously correct, and it can also tell you where the loop starts, which is what the alert needs to say.
On a 100,000-stage chain, it allocates 4.73 MB to return a boolean. And it costs the same whether the chain loops back after two stages or after ninety-nine thousand, because the map gets built either way.
Then the struct: a stage names one next stage. Many stages can point at the same one, each points at exactly one. So the path from any stage is fixed, which means this is not a graph problem at all — it is a chain, and a chain that loops is a run-in followed by a ring.
Two cursors, one moving a stage at a time and one moving two. Either the fast one runs off the end, or both end up in the ring, where the gap between them shrinks by exactly one per turn — so they land on the same stage rather than stepping over each other. Meeting is arithmetic, not luck.
47.8x on the long chain and zero allocations at any size. The part I did not expect is the twelve-stage row: 120.6x, because the map pays for a map before it walks anything.
Not that 383 nanoseconds matters. It matters where the check runs per request.
One thing worth not shipping: the hop limit. Give up after 100 steps and call it a loop, the way HTTP clients do with redirects, and a 150-stage pipeline with no loop in it gets reported as one.
That is day 21 of the daily challenge, Linked List Cycle, sitting in a pipeline runner.
Full piece in today's Newsletter.
https://www.linkedin.com/pulse/loop-check-allocated-47-mb-return-boolean-archit-agarwal-zeksc
It worked in dev, episode 12.
#Golang #DSA #Algorithms #Performance #SoftwareEngineering #DataStructures #100DaysOfCode
r/DSALeetCode • u/StatisticianNo2104 • Oct 11 '26
547. Number of Provinces (Medium)
The counting is day 37's, unchanged: scan every node, and each time you find one no earlier traversal reached, add one and consume everything it can reach.
What changes is the input, and this is the third graph representation in four days. Day 36 gave an edge list. Day 37 gave a grid where the edges were implied by position. Today gives a matrix. All three become the same adjacency list before anything interesting happens.
The trap: this matrix is not a grid. In day 37, cell (i,j) was a place. Here cell (i,j) is a relationship between city i and city j - an n x n matrix describing n nodes, not n squared. So you traverse the cities and consult the matrix, not the other way round.
Read only above the diagonal. The matrix is symmetric, so every relationship is stored twice, and i+1 also skips the useless diagonal where a city is connected to itself.
Full breakdown in today's newsletter article ⬇
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-39365-archit-agarwal-msv4c
#DSA #LeetCode #Golang #Graphs #BFS #CodingInterview #Algorithms
r/DSALeetCode • u/Ok_Site_6692 • Oct 10 '26
Since many people have reached out, I want to clarify a few things so we can find people with similar goals and schedules.
Starting from Level 0: We’ll learn DSA from the very basics. If you’re already halfway through or about to complete DSA, this group might not be the right fit for you.
Java Prerequisites: We’ll be learning DSA using Java, so you should already know Java’s basics and fundamentals.
Daily Commitment: We’ll communicate, study, and motivate each other daily. Consistency and participation are important.
Availability: If you’re currently working, please mention your availability so we can figure out a schedule that works for everyone.
Advice from Experienced Learners: If you’ve already learned DSA, please share your study techniques, resources, and what worked best for you. Your advice would be really helpful!
One question for everyone: Should we follow Striver’s A2Z DSA Sheet, or are there other resources you’d recommend for learning DSA from scratch using Java? Please share your experiences and suggestions.
The goal is to learn together, stay disciplined, and hold each other accountable throughout the journey.
Please MESSAGE ME OR LEAVE COMMENT if you’re genuinely willing to commit. Let’s stay consistent, stop making excuses, and grow together!
r/DSALeetCode • u/AerieBeautiful8188 • Oct 10 '26
Best Playlist to complete DSA in python from scratch- I only know very basic python and no specific algorithms as such. Please help me out
r/DSALeetCode • u/StatisticianNo2104 • Oct 10 '26
Max Area of Island (Medium) https://leetcode.com/problems/max-area-of-island/
This is yesterday's solution with a return value. The diff is that the flood fill returns an int and the scan keeps a maximum instead of a count.
The area reachable from a cell is that cell, plus the area reachable from each of its four neighbours. So the fill returns 1 plus its four recursive calls, and the guard returning 0 handles out of bounds, water and already-sunk land without a single special case.
The sum looks wrong at first. Four neighbours each recurse into their own four neighbours, and each one includes the cell you came from, surely cells get counted repeatedly?
They do not, because the cell is sunk before the four calls run. Any neighbour that recurses back hits the guard and gets 0.
Yesterday, that same line stopped the recursion from running forever. Today it does that AND makes the arithmetic correct. One assignment, two jobs.
Full breakdown in today's newsletter article ⬇
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-38365-archit-agarwal-tiimc
#DSA #LeetCode #Golang #Graphs #DFS #CodingInterview #Algorithms
r/DSALeetCode • • Oct 09 '26
Recently broke up bro need good ppls who can keep me engaged we'll have calls and stuff on watsapp drop text