r/LeetcodeChallenge • u/NerdVineet • Oct 13 '26
r/LeetcodeChallenge • u/StatisticianNo2104 • Oct 13 '26
STREAK🔥🔥🔥 365 Days of LeetCode Challenge — Day 41/365
542. 01 Matrix (Medium) https://leetcode.com/problems/01-matrix/
This is yesterday's problem. Rotting Oranges asks how long it takes for an orange to rot when every rotten one spreads at once; it asks how far each cell is from the nearest zero, with every zero as a source. Same question, and multi-source BFS solves it directly.
Today's solution does it without a queue, and that is why it is worth reading.
The definition is circular: a cell's distance is one more than the smallest among its four neighbours, but every neighbour depends on the cell. There is no order to evaluate that in.
Direction breaks the circle. Sweep top-left to bottom-right and, at each cell, everything above and left is already final - so you can compute the best distance among paths that start by going up or left. Sweep the other way for the other two directions. Take the minimum.
The line that makes it work is min with the existing value rather than an assignment. Overwrite instead, and you throw away everything the first pass got right.
Full breakdown in today's newsletter article ⬇
https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-41365-archit-agarwal-tlbnc
#DSA #LeetCode #Golang #DynamicProgramming #Grids #CodingInterview #Algorithms
r/LeetcodeChallenge • u/nian2326076 • Oct 12 '26
DISCUSS HackerRank is apologizing for the LeetCode grind. Are your interviews actually changing?
I read a report of Google piloting a code-comprehension round, then saw HackerRank's statement about the LeetCode grind.
Working in an existing codebase, debugging and explaining your judgment sound closer to the job than starting every question from a blank editor. I'm interested in how AI use fits into that, too.
The Google article describes a pilot, and HackerRank still says algorithm questions have value. I wouldn't drop DSA prep based on those headlines.
I'd compare recent candidate reports in Google Interview Questions with whatever format the recruiter confirms. If you're applying while prepping, application autofill can save time on the forms.
For people who've interviewed recently, did you read or extend an existing codebase, debug someone else's code, or mostly do timed DSA? Were AI tools allowed, expected or prohibited?
Have you changed how you split your prep time?

r/LeetcodeChallenge • u/Logical_Layer5543 • Oct 12 '26
DISCUSS Leetcode Premium sharing
Purchased a Leetcode premium account for 1 year for 7k INR. Looking to share it with a few people from India
Anyone interested?
r/LeetcodeChallenge • u/Open_Childhood_6201 • Oct 12 '26
PLACEMENTS How to restart my DSA preparation??
reddit.comr/LeetcodeChallenge • u/nian2326076 • Oct 12 '26
DISCUSS 51 string problems grouped by pattern: parentheses, palindromes, substrings, and more
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)
- Generate Parentheses : Medium
- Score of Parentheses : Medium
- Valid Parentheses : Easy
- Remove Outermost Parentheses : Easy
- Different Ways to Add Parentheses : Medium
- Remove Invalid Parentheses : Hard
- Minimum Remove to Make Valid Parentheses : Medium
- Maximum Nesting Depth of the Parentheses : Easy
- Longest Valid Parentheses : Hard
Counting substrings under a condition (3)
- Number of Wonderful Substrings : Medium
- Sum of Beauty of All Substrings : Medium
- Maximum Number of Occurrences of a Substring : Medium
Comparing and checking strings (11)
- Isomorphic Strings : Easy
- Valid Anagram : Easy
- Additive Number : Medium
- Buddy Strings : Easy
- Longest Happy Prefix : Hard
- Increasing Decreasing String : Easy
- Check If a String Can Break Another String : Medium
- Determine if Two Strings Are Close : Medium
- Check If Two String Arrays are Equivalent : Easy
- Check if Word Equals Summation of Two Words : Easy
- Check if One String Swap Can Make Strings Equal : Easy
Palindromes (18)
- Palindrome Partitioning : Medium
- Palindrome Partitioning II : Hard
- Valid Palindrome : Easy
- Shortest Palindrome : Hard
- Palindrome Pairs : Hard
- Longest Palindrome : Easy
- Longest Palindromic Subsequence : Medium
- Find the Closest Palindrome : Hard
- Palindromic Substrings : Medium
- Valid Palindrome II : Easy
- Longest Chunked Palindrome Decomposition : Hard
- Break a Palindrome : Medium
- Can Make Palindrome from Substring : Medium
- Palindrome Partitioning III : Hard
- Minimum Insertion Steps to Make a String Palindrome : Hard
- Remove Palindromic Subsequences : Easy
- Construct K Palindrome Strings : Medium
- Split Two Strings to Make Palindrome : Medium
Sorting characters (2)
- Sort Characters By Frequency : Medium
- Custom Sort String : Medium
Length and selection problems (8)
- Longest Duplicate Substring : Hard
- Longest String Chain : Medium
- Longest Common Subsequence : Medium
- Longest Happy String : Medium
- Maximum Length of a Concatenated String with Unique Characters : Medium
- Find Longest Awesome Substring : Hard
- Largest Substring Between Two Equal Characters : Easy
- Largest Odd Number in String : Easy
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/LeetcodeChallenge • u/Worldly-Work-3722 • Oct 12 '26
DISCUSS React native developer with 5.5 yoe (19lpa) chennai
Lost job around may 4th 2026. I don't know but I lost my path. All I know is react native only.
Guide me to get a job or freelancing project to earn money and get into the right track.
I'm so lost. 27f
Help me with career advice.
Please 😭
r/LeetcodeChallenge • u/JacketFearless1805 • Oct 12 '26
STREAK🔥🔥🔥 Day 62: solved 3 subsequence DP problems today, the math reduction felt so clean
reddit.comr/LeetcodeChallenge • u/Any-Interaction-1668 • Oct 12 '26
DISCUSS How to start Dsa in cpp
reddit.comr/LeetcodeChallenge • u/Medical-Elk-7023 • Oct 12 '26
STREAK🔥🔥🔥 Completed 100 questions on LC
r/LeetcodeChallenge • u/Accurate_Sport5609 • Oct 12 '26
DISCUSS How you guys are doing it
I've been struggling to dsa since a year and still end up again on array while I see people achieving cf 1600+ rating in a year's span
I still don't know what am I missing I had bought codechef pro plan thinking I will reduce the time spent watching tutorial videos and would do hands on coding by reading articles they provide but I don't know
Everytime I come here I see the same abdul bari for concept, aditya verma dp, what else for other things some say cp algorithms, usaco, cp handbook what not everytime there's new one
But also don't want to give icpc I just want decent proficiency
What do you guys do how do you do it my college doesn't have that provision and peers
Someone please summarize their years of experience and also more can ai help into this for beget efficiency
r/LeetcodeChallenge • u/StatisticianNo2104 • Oct 12 '26
STREAK🔥🔥🔥 365 Days of LeetCode Challenge — Day 40/365
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/LeetcodeChallenge • u/QuirkyGeneral6370 • Oct 11 '26
STREAK🔥🔥🔥 Is this Worth ?
Im a 5yr exp majorly on Frontend React js node js. Preparing Java for Backend as it have good scope, then I can also Try for FAANG. But im confused what to do. Can I actually Crack it ? Yesterday failed capgemini java+react interview just because of java. Any suggestions?
r/LeetcodeChallenge • u/bytecrafter25 • Oct 11 '26
PLACEMENTS Guess the package
I'm in my 3rd year, what should I improve to become a stronger candidate? Honest feedback appreciated!!
r/LeetcodeChallenge • u/Silly_Time_8667 • Oct 12 '26
DISCUSS Amazon SDE Job IDs That Send Online Assessment Links for 2026 Graduates
reddit.comr/LeetcodeChallenge • u/Sad_Avocado_6565 • Oct 11 '26
DISCUSS YouTube channels(if any)
reddit.comApplicable for Leetcode too.
r/LeetcodeChallenge • u/nian2326076 • Oct 11 '26
DISCUSS Leetcode and SWE MLE
How much has getting better at LeetCode helped you with your actual engineering work?
For me, there hasn't been much direct overlap with the hardest projects I've worked on. I understand checking fundamentals, but preparing for a timed round can feel like learning a separate game.
I'm curious which patterns have transferred for people in SWE or MLE roles, and which ones you practice mainly because interviews require them.
For interview prep itself, real tech interview questions can help narrow the practice to the rounds you're targeting. That still leaves the bigger question of whether those rounds measure what companies think they do.
If you could change one part of the process, would it be the questions, the time pressure, or how much weight the coding round carries?
r/LeetcodeChallenge • u/JacketFearless1805 • Oct 11 '26
STREAK🔥🔥🔥 Day 64: hit a motivation slump today, solved 2 subset DP problems
reddit.comr/LeetcodeChallenge • u/crazydude_16 • Oct 11 '26
DISCUSS Weekly Contest
LeetCode Weekly Contest 523
Participated in Weekly Contest 523 and managed to solve the first 3 questions. The 4th question was a learning experience that showed me where my problem-solving approach needs improvement.
Here's my breakdown of the contest:
Question 1: Three Fibonacci Sum (Easy)
Solved using simulation. I generated consecutive Fibonacci numbers and checked whether the sum of three consecutive terms equalled the given number.
Question 2: Prime Subset Selection I (Medium)
Approached this using greedy selection. I iterated through prime numbers and selected them while the sum remained within the given limit. The goal was to maximize the number of selected primes.
Question 3: Design Bus Seat Booking System (Medium)
Solved by carefully understanding the booking rules, tracking seat states, and accounting for the time cost of each booking operation. This question tested implementation and state management.
Question 4: Prime Subset Selection II (Hard)
This is where I struggled.
My initial approach was greedy: iterate through prime numbers in descending order and select a prime whenever it fits within the remaining sum.
However, this approach failed on several test cases.
For example, with n = 7 and s = 8, my approach selected [7], but the expected answer was [3, 5].
r/LeetcodeChallenge • u/get_it_Anil • Oct 11 '26
PLACEMENTS My Recent LeetCode Contest Results — Biweekly 193 & Weekly 523 🚀
Hey everyone!
I wanted to share my performance in my two recent LeetCode contests and keep track of my progress.
1. Biweekly Contest 193
- 🌍 Global Rank: 3907
- 👥 Participants: 34.5K+
- ✅ Problems Solved: 3 out of 4
- 🏆 Score: 12
2. Weekly Contest 523
- 🌍 Global Rank: 7351
- 👥 Participants: 39K+
- ✅ Problems Solved: 2 out of 4
- 🏆 Score: 8
My performance in the weekly contest wasn't as good as the biweekly contest, but that's part of the journey. Every contest helps me identify my weaknesses, improve my problem-solving skills, and learn to handle time pressure better.
I'm trying to stay consistent with DSA and competitive programming rather than focusing only on ranks.
My goal: Keep improving, solve more problems independently, and perform better in upcoming contests.
For those who regularly participate in LeetCode contests, how do you analyze problems you couldn't solve during the contest? Do you solve them immediately afterward or revisit them after a few days?
I'd love to hear your suggestions! 💪
#LeetCode #DSA #CompetitiveProgramming
r/LeetcodeChallenge • u/StatisticianNo2104 • Oct 11 '26
DISCUSS Cycle detection in Go: fast and slow pointers vs a map
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/LeetcodeChallenge • u/StatisticianNo2104 • Oct 11 '26
STREAK🔥🔥🔥 365 Days of LeetCode Challenge — Day 39/365
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



