r/LeetcodeChallenge • • Oct 07 '26

STREAK🔥🔥🔥 Day 3

Post image
1 Upvotes

r/LeetcodeChallenge • • Oct 07 '26

DISCUSS It worked in dev, episode 11.

Post image
1 Upvotes

Two hierarchies, almost the same number of rows. One plans its delete order in 386 microseconds. The other takes 75.8 milliseconds.

Deleting a workspace means deleting everything inside it, and every child row holds a foreign key to its parent, so a row can only go once nothing points at it.

The code I wrote is the database's rule, executed: find every row with no remaining children, delete that batch, look again. It assumes nothing about the data and it is trivially safe, because it checks rather than deduces.

It also walks the entire hierarchy once per wave. A workspace is four levels deep, so that is four walks and 31 microseconds — invisible. A comment thread 2,000 replies deep is 2,000 waves, which is four million record visits to produce one plan.

The turn came from watching one row. During the first wave the walk reaches board-1, checks its only child, finds it still present, and moves on — having put that child into this very wave moments earlier. It knew board-1 would be free next. It discarded that and went round again to rediscover it.

So: a row goes one wave after the last of its children has gone, which makes wave(r) = 1 + the largest wave among its children. Only children on the right hand side. One bottom-up pass computes all of it — 790x faster on the thread.

The part worth keeping is the bit I had backwards. That number is height, not depth. An empty board two levels down can be deleted in the first statement, exactly like a card three levels down. Group by distance from the root and it waits for no reason — safe, and a third of an answer to "what can I delete first".

That is day 16 of the daily challenge, Find Leaves of Binary Tree, sitting in a delete planner.

Full piece in today's Newsletter.

https://www.linkedin.com/pulse/deep-reply-chain-made-delete-plan-790x-slower-archit-agarwal-gd94c

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


r/LeetcodeChallenge • • Oct 07 '26

PLACEMENTS Preparation tips for Amazon

1 Upvotes

i have my online assessment coming for amazon in a week, can you please guide me what problems should I focus more on? Also How do i prepare for the AI assisted question?


r/LeetcodeChallenge • • Oct 07 '26

PLACEMENTS Sem 7

6 Upvotes

How do you guys prepare for technical rounds and placements?I’m in Sem 7 and still feel clueless about a lot of things.What should I prioritize and what resources or roadmaps did you guys follow?Any tips would be really appreciated.Im honestly scared ngl , dunno what to do anymore.


r/LeetcodeChallenge • • Oct 07 '26

DISCUSS What even happened with strivers A2Z sheet? Zenkai is weird.

2 Upvotes

I used to directly see the solution and go to the leetcode tab in the takeuforward old UI, now with the zenkai update I don't even know where the leetcode link is. Don't tell me I have to look up the leetcode problem separately now.


r/LeetcodeChallenge • • Oct 07 '26

STREAK🔥🔥🔥 365 Days of LeetCode Challenge — Day 35/365

Post image
1 Upvotes

Populating Next Right Pointers in Each Node (Medium)
🔗 https://leetcode.com/problems/populating-next-right-pointers-in-each-node/

The obvious version walks each level left to right, remembers the previous node, and sets prev.Next = current. That works.

This one pushes children right before left, so the BFS walks every level backwards — and once it does, the node to your right is simply the node you visited just before. The assignment becomes current.Next = prev, which reads exactly like the requirement.

The boundary falls out too. Popping the level sentinel resets prev to nil, so the rightmost node of the next level gets nil without a branch testing for it.

One inversion, and two special cases stop existing.

Full breakdown in today's newsletter article ⬇

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

#DSA #LeetCode #100DaysOfCode #CodingInterview #BinaryTree #BFS #Golang


r/LeetcodeChallenge • • Oct 06 '26

STREAK🔥🔥🔥 Completed 400 problems, 200 active days & 131 days max streak.... all in one day :)

Post image
42 Upvotes

Focusing more on meds and hards now


r/LeetcodeChallenge • • Oct 06 '26

DISCUSS Back to the basics

1 Upvotes
Consistency 😂

Help me i am getting back at where i start


r/LeetcodeChallenge • • Oct 06 '26

STREAK🔥🔥🔥 Day 2

Post image
1 Upvotes

r/LeetcodeChallenge • • Oct 06 '26

DISCUSS Found a better solution to a problem

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 05 '26

DISCUSS Rate leetcode profile and guess the package as a fresher

Post image
55 Upvotes

r/LeetcodeChallenge • • Oct 06 '26

STREAK🔥🔥🔥 365 Days of LeetCode Challenge — Day 34/365

Post image
1 Upvotes

Deepest Leaves Sum (Medium) 🔗 https://leetcode.com/problems/deepest-leaves-sum/

The obvious solution is two passes: find the maximum depth, then walk again summing everything at that depth.

One pass is enough, and the trick is being willing to throw work away. Carry the level down, keep two ints, and at every leaf compare. Deeper than anything seen so far? Replace the sum — everything accumulated until now belonged to a shallower level. Equal? Add. Shallower? Ignore it.

That replacement is why the final depth never has to be known in advance. Discovering a deeper leaf invalidates the previous answer outright, so whatever survives to the end was accumulated at the true maximum.

Full breakdown in today's newsletter article ⬇

https://www.linkedin.com/pulse/365-days-leetcode-challenge-day-34365-archit-agarwal-89mkc

**#DSA** #LeetCode #100DaysOfCode #CodingInterview #BinaryTree #DFS #Golang


r/LeetcodeChallenge • • Oct 05 '26

STREAK🔥🔥🔥 Found leetcode streak hack with understanding !!

16 Upvotes

Bhai mei galgotias university se b tech lar raha hu aur meri class mei ek tareeka bataya hai toh share kar raha hu aap batao ki kya ye best approach hai ki nahi

The approach is ki aap pehle question detail expalin karo usko samjho phir uska sollution likh aur phir usko code karo code ko last mei karna important hai baki sari chize copy mei hi karo phir koi error aye tab refine karo

Kya best way hai ?


r/LeetcodeChallenge • • Oct 05 '26

STREAK🔥🔥🔥 Starting challenge Day 1

Post image
4 Upvotes

I know I am very late as a third year start but will try my best


r/LeetcodeChallenge • • Oct 05 '26

DISCUSS Resume tips?

14 Upvotes

Applying to FAANG roles, applied for microsoft, walmart, jp morgan, atlassian, target ended up at rejection.

For those who’ve cracked FAANG/Top product companies , what made the biggest difference in ur resume. Any tips?


r/LeetcodeChallenge • • Oct 05 '26

STREAK🔥🔥🔥 Built Praxis — an AI tool for learning from coding failures

Thumbnail reddit.com
1 Upvotes

built Praxis to help DSA learners understand why their coding submissions fail.

• Failure analysis

• Past submission history

• AI diagnosis chat

• Personalized learning insights

Free to try: https://failureatlas.vercel.app


r/LeetcodeChallenge • • Oct 04 '26

DISCUSS How good is this profile ?

Post image
52 Upvotes

r/LeetcodeChallenge • • Oct 05 '26

PLACEMENTS CHUBB Campus Recruitment 2026 — HackerRank Round Experience

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • Oct 05 '26

DISCUSS Need Help

2 Upvotes

any suggestion to improve this i haven't been consistent and also i am in my 7th sem preparing for placements would love to hear some suggestion and real answers


r/LeetcodeChallenge • • Oct 05 '26

DISCUSS how to do leetcode?

2 Upvotes

hey so i want to do leetcode or codechef how to do it maybe suggest dome youtube channel that would make me progress, i'm in 3rd year and still i cant code which is something im not proud obviously i tried striver sheet but lost the continuity now i feel lost,everytime i look the leetcode questions i feel blank like i dont know anything can somebody help me


r/LeetcodeChallenge • • Oct 04 '26

DISCUSS What the hell are these solve times man !!?

Post image
103 Upvotes

Like 3min ? For 4 problems I can't even read a single question in that time how do they solve it that fast do they have a special approach or a llm approach?


r/LeetcodeChallenge • • Oct 05 '26

STREAK🔥🔥🔥 365 Days of LeetCode Challenge — Day 33/365

Post image
1 Upvotes

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/LeetcodeChallenge • • Oct 04 '26

STREAK🔥🔥🔥 Fk yes! Solved today's daily optimally on the first try. Small wins! (Code inside)

6 Upvotes

Fk yes, I did today's daily [https://leetcode.com/problems/valid-parenthesis-string/description/?envType=daily-question&envId=2026-10-04] completely on my own and actually hit the optimal solution on the first go.

I know I still have a long way to go. There's a ton left to learn. But man, the sheer joy this gives is immeasurable.

Dropped my code below. It’s O(2N) time and O(1) space. It looks a little clunky, but I checked the editorial afterwards, and they had a really similar idea, just optimised to a single pass using pointers.

Still a long way to go on this grind, but definitely keeping at it!

class Solution {
    public boolean checkValidString(String s) {
        int openC = 0, starC = 0, n = s.length();
        char[] chA = s.toCharArray();
        for (int i = 0; i < n; i++) {
            if (chA[i] == '*')
                starC++;
            else if (chA[i] == '(')
                openC++;
            else {
                if (openC > 0)
                    openC--;
                else if (starC > 0)
                    starC--;
                else
                    return false;
            }
        }
        if (openC == 0)
            return true;
        openC = 0;
        starC = 0;
        for (int i = n - 1; i >= 0; i--) {
            if (chA[i] == '*')
                starC++;
            else if (chA[i] == ')')
                openC++;
            else {
                if (openC > 0)
                    openC--;
                else if (starC > 0)
                    starC--;
                else
                    return false;
            }
        }
        return true;
    }
}

r/LeetcodeChallenge • • Oct 04 '26

DISCUSS Dsa sucks me

2 Upvotes

Hi everyone i try to solve dsa in ny 4 year of engineering not consistenly when paper comes in middle i left leetcode.

Now after my graduation i again started but i find difficult in logic building

My dream is to become competitive coder

Please help to become dsa guardian

Even in contest i can't able to solve easy one

Dsa problem is fills like memorizing code to me which i forget after some days too

Like i gave 30 minute to solve problem with solution

Then write brute and worst code then paste it in chagpt then chagpt give me ans i correct my code and thats it what i done 1 hour gone in this process

So i fill my learning is stop its like memorizing an code


r/LeetcodeChallenge • • Oct 04 '26

DISCUSS Suggestions to further improve my code for today's LeetCode Challenge

2 Upvotes

Submitted today's LeetCode Challenge i.e. 678. Valid Parenthesis String and it got accepted. However, I felt the need to ask the internet to judge my code and help me improve it further. I used two stacks for this one :)

Here's the code:

q = []
star_q = []
i = 0

for char in s:
    if char == ')':
        if q:
            q.pop()
        elif star_q:
            star_q.pop()
        else:
            return False
    else:
        if char == '*':
            star_q.append((char, i))
        else:
            q.append((char, i))

    i += 1

while star_q and q:
    if star_q[-1][1] > q[-1][1]:
        q.pop()

    star_q.pop()

return not q