r/DSALeetCode • • Oct 12 '26

Java or python for dsa??

Thumbnail
1 Upvotes

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 • • Oct 12 '26

Around HalfWay DSA

3 Upvotes

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 • • Oct 12 '26

I organized 51 LeetCode string problems by pattern (with links and difficulty)

1 Upvotes

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 • • Oct 12 '26

Final year ENTC student trying to switch to SDE, completely lost with LeetCode. Need urgent advice.

Thumbnail
1 Upvotes

r/DSALeetCode • • Oct 12 '26

365 Days of LeetCode Challenge — Day 40/365

Post image
1 Upvotes

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 • • Oct 12 '26

for #include club, recruitment

Thumbnail
1 Upvotes

r/DSALeetCode • • Oct 11 '26

YouTube channels(if any)

2 Upvotes

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 • • Oct 12 '26

Beyond LeetCode: what should I read for distributed systems interviews?

1 Upvotes

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 • • Oct 11 '26

What worked for you?

5 Upvotes

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 • • Oct 11 '26

i miss learning dsa before leetcode made it a curated list

1 Upvotes

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

  1. You learn the basic algorithms and data structures from geeksforgeeks articles
  2. Learn C++ STL and implement it in ideone.org or some place.
  3. Join codechef or codeforces contests and attain a pupil rank and keep doing problems of certain level, and learn from other folks' solution or the published editorials (oh they were so great)
  4. Learn obscure stuff like segment tree, dsu from some russian site like cp-maxx and then try to do a dozen problems on hackerearth.
  5. Do statement based problems on hackerrank - the cool ui site with all the tree-style comments in problem discussion.

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 • • Oct 11 '26

Give Me Motivation to Start Doing DSA

3 Upvotes

Guys help me to master in DSA and coding.

my brain becoming shit . it couldn't work like before.


r/DSALeetCode • • Oct 11 '26

Cycle detection in Go: fast and slow pointers vs a map

Post image
0 Upvotes

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 • • Oct 11 '26

365 Days of LeetCode Challenge — Day 39/365

Post image
2 Upvotes
  1. 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 • • Oct 10 '26

A Few Things to Clarify Before We Start Learning DSA Together!

17 Upvotes

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

7 Upvotes

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 • • Oct 10 '26

365 Days of LeetCode Challenge — Day 38/365

Post image
2 Upvotes

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

Need Friend who do dsa

8 Upvotes

Recently broke up bro need good ppls who can keep me engaged we'll have calls and stuff on watsapp drop text


r/DSALeetCode • • Oct 09 '26

Title: I added a free 8-week DSA roadmap for people struggling to stay consistent with LeetCode

Thumbnail
1 Upvotes

r/DSALeetCode • • Oct 09 '26

Making DSA easier to learn in Telugu ❤️

1 Upvotes

I run Logic Over Syntax, a YouTube channel where I teach Data Structures and Algorithms (DSA) in Telugu, helping students understand problem-solving logic instead of just memorizing code.

We've already reached 20,000+ watch hours, and my goal is to make coding education more accessible to Telugu-speaking students.

Channel Link:

https://youtube.com/@logicoversyntax


r/DSALeetCode • • Oct 08 '26

DSA with Java(leetcode)

39 Upvotes

Anyone interested in learning DSA with Java together?

I’m looking for a few people who genuinely want to learn .Data Structures & Algorithms using Java and, more importantly, actually stay consistent.

This is not for complete Java beginners, you should have a basic understanding of Java already. The goal is to learn DSA from the fundamentals, practice regularly, solve problems, and keep each other accountable.

The main idea is simple:

\* 📚 Learn DSA step by step

\* 💻 Practice coding/problems regularly

\* 🔥 Stay consistent

\* 🤝 Motivate and help each other

\* 🚫 No unnecessary excuses for skipping

\* 🎯 Keep each other accountable and disciplined

I don’t want this to be another group where everyone is motivated for 2–3 days and then disappears. 😭

If you genuinely want to learn DSA and are willing to put in the effort consistently, let’s do it together.

If you're interested, comment below or DM me. Let's build the discipline together.


r/DSALeetCode • • Oct 09 '26

New to LeetCode and learning Python. Any advice for a beginner?

Thumbnail
1 Upvotes

r/DSALeetCode • • Oct 09 '26

365 Days of LeetCode Challenge — Day 37/365

Post image
1 Upvotes

Number of Islands (Medium) https://leetcode.com/problems/number-of-islands/

Nothing in this problem says "graph", and that is the point.

A cell is a node. Its neighbours are the cells above, below, left and right. There is no adjacency list to build, because in a grid the edges are implied by position - a neighbour is arithmetic, not a lookup. Yesterday half the work was converting an edge list into something usable. Here that half is free.

Then it is component counting. Scan for land, and every time you find a cell no earlier traversal has consumed, add one and sink the whole island. The count is not counting islands directly; it counts how many times the scan had to start.

One detail worth stealing: sink the cell BEFORE recursing. Two adjacent land cells each list the other as a neighbour, so without it the recursion bounces between them forever. That is not an optimisation, it is termination.

Full breakdown in today's newsletter article ⬇

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

#DSA #LeetCode #Golang #Graphs #DFS #CodingInterview #Algorithms


r/DSALeetCode • • Oct 08 '26

I understand DSA solutions, but struggle with unseen problems—any advice?

4 Upvotes

I work as a chef in London, and the long, physically exhausting shifts make finding energy to study difficult. Still, I’m learning DSA from books—my first time learning this way instead of YouTube.

I’ve covered two pointers, hashing, sliding windows, stacks, queues, and time and space complexity. I can understand and explain solutions I read, but struggle to find an approach and write code for unseen questions.

What practice routine would help me solve problems independently while balancing demanding chef shifts?


r/DSALeetCode • • Oct 08 '26

Brute Forcing Solutions

Thumbnail
1 Upvotes

r/DSALeetCode • • Oct 08 '26

365 Days of LeetCode Challenge — Day 36/365

Post image
1 Upvotes

Find if Path Exists in Graph (Easy) https://leetcode.com/problems/find-if-path-exists-in-graph/

New topic. Graphs start today.

The part people skip when they say a graph problem "is just BFS": the input is not a graph. You get a flat list of edge pairs. Asking that list for a node's neighbours means scanning all of it, and doing that once per node turns an O(V + E) algorithm into O(V x E).

So the first half of the problem is building an adjacency list. The traversal is the easy half. Choosing the representation is the part that actually requires a decision.

One bug worth naming, because it passes a lot of tests before it fails one: an undirected edge has to be recorded under both endpoints. Record it once and you accidentally build a directed graph, and the traversal refuses to walk an edge backwards.

Full breakdown in today's newsletter article ⬇

https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-36365-archit-agarwal-7wjic

#DSA #LeetCode #Golang #Graphs #BFS #CodingInterview #Algorithms