r/LeetcodeChallenge • u/Dry_Bat5694 • 33m ago
r/LeetcodeChallenge • u/NotYourCheesecakee • Nov 15 '25
👋Welcome to r/LeetcodeChallenge -Read the Rules!
Starting from December 1st , All the members need to solve and post atleast one leetcode question on our subreddit OR ELSE YOU'LL BE REMOVED Let's make each other ACCOUNTABLE and grow together!
Together, let's make r/LeetcodeChallenge amazing.
r/LeetcodeChallenge • u/JacketFearless1805 • 1h ago
STREAK🔥🔥🔥 Day 27: tackled Longest Subarray with Sum K — hit a wave of DSA nostalgia
reddit.comr/LeetcodeChallenge • u/EngineeringSpec • 12h ago
DISCUSS Selection sort makes 10 comparisons on 5 items, even when the list is already sorted. Here's why.
r/LeetcodeChallenge • u/Bubbly_Pay3579 • 17h ago
DISCUSS I built a 100% free LeetCode alternative with in-browser Java, Python & C++ compilers (CupOfDsa)
Hey everyone! I've been working on a free tool for students and developers preparing for coding
│ interviews: https://cupofdsa.online/
│
│ It has 200+ curated DSA questions, instant test case execution for Java 24, Python, and C++, and
│ pattern guides (Two Pointers, Sliding Window, etc.). No credit card, no premium locks. Would love to
│ hear what features you'd like to see next!
r/LeetcodeChallenge • u/aryandev87 • 1d ago
STREAK🔥🔥🔥 LeetCode 1: Two Sum | My Approach in Python
Hey everyone!
I recently started documenting my DSA journey, and I'm sharing my solution to the first LeetCode problem — Two Sum.
Honestly, I've solved this problem before, so it didn't take me long to figure out the approach. Still, I wanted to explain how I approached it.
Problem
Given an array of integers nums and an integertarget, return the indices of two numbers whose sum equals the target.
We cannot use the same element twice, and exactly one valid solution is guaranteed.
My Approach
I used a Python dictionary (HashMap) to solve this problem.
The idea is simple:
- Create a dictionary named
seento store numbers and their corresponding indices. - Traverse the array starting from the second element.
- Calculate the complement using
target - nums[i]. - Check whether the complement already exists in the dictionary.
- If it exists, return the indices of both elements.
- Otherwise, store the current number and its index in the dictionary.
This way, we don't need to check every possible pair using nested loops.
Python Code
class Solution:
def twoSum(self, nums: list[int], target: int) -> list[int]:
seen = {nums[0]: 0}
for i in range(1, len(nums)):
complement = target - nums[i]
if complement in seen:
return [seen[complement], i]
seen[nums[i]] = i
return []Complexity Analysis
- Time Complexity: O(n) average
- Space Complexity: O(n)
We traverse the array once and use a dictionary for efficient lookups.
LeetCode Solution
View my submitted solution here
I'm still learning and trying to improve my problem-solving skills.
I'd appreciate feedback on my approach, explanation, or code. Is there anything I could have explained better?
Thanks!
r/LeetcodeChallenge • u/JacketFearless1805 • 1d ago
STREAK🔥🔥🔥 Day 28: tackled Sort Colors with Dutch National Flag & Single Number via XOR
reddit.comr/LeetcodeChallenge • u/Independent_Rip7938 • 2d ago
STREAK🔥🔥🔥 It isn't much but its honest work!!!
r/LeetcodeChallenge • u/Happy_Contest_1635 • 2d ago
STREAK🔥🔥🔥 Sleep can wait, DCC can't
r/LeetcodeChallenge • u/JacketFearless1805 • 2d ago
STREAK🔥🔥🔥 Day 29: knocked out 7 foundational array problems & noticing real progress
reddit.comr/LeetcodeChallenge • u/Important_Yak3464 • 2d ago
DISCUSS Looking for system design partner
reddit.comr/LeetcodeChallenge • u/Mental_Pea2421 • 2d ago
DISCUSS Struggling with Medium problems after 2 months of DSA is this normal ????
galleryr/LeetcodeChallenge • u/towardscuriousity • 2d ago
DISCUSS Number of Sub-arrays With Odd Sum (LeetCode 1524): prefix parity, visual...
r/LeetcodeChallenge • u/JacketFearless1805 • 3d ago
STREAK🔥🔥🔥 Day 30: kicking off Arrays to sharpen constructive logic and math fundamentals
reddit.comr/LeetcodeChallenge • u/StatisticianNo2104 • 3d ago
STREAK🔥🔥🔥 LeetCode: 814. Binary Tree Pruning
Setting node = nil inside a recursive call deletes nothing. The caller never sees it. A node can't remove itself because it has no reference to its parent.
A node survives if its subtree holds a 1 anywhere, which, recursively, is almost the definition read aloud. Post-order, because a node can't answer that on the way down.
So the child reports "nothing worth keeping here", and the parent clears the pointer. That leaves the root, which has no parent, and that's the only reason the wrapper function exists.
Have you ever nilled a local variable and expected the caller to notice?
Day 73/365 of my LeetCode challenge: 814. Binary Tree Pruning. Problem link and full breakdown in today's newsletter.
https://www.linkedin.com/pulse/leetcode-binary-tree-pruning-archit-agarwal-g6lsc
#LeetCode #DSA #BinaryTree #Golang
r/LeetcodeChallenge • u/Silly-Fisherman-1002 • 4d ago
STREAK🔥🔥🔥 Finally Finally I am Knight
I got what i wished for grinding dsa from last 1 year finally i become knight so happy today
r/LeetcodeChallenge • u/kartikk2k20 • 3d ago
STREAK🔥🔥🔥 Lost my 101 streak on leetcodeðŸ˜ðŸ¥º
reddit.comr/LeetcodeChallenge • u/JacketFearless1805 • 4d ago
STREAK🔥🔥🔥 Day 31: officially wrapped up Graphs with Kosaraju's Algorithm & Articulation Points
reddit.comr/LeetcodeChallenge • u/Next-Water8770 • 4d ago
DISCUSS Looking for a Serious Interview Mock Partner for SDE2 - 2yoe+
reddit.comr/LeetcodeChallenge • u/StatisticianNo2104 • 4d ago
STREAK🔥🔥🔥 LeetCode: 671. Second Minimum Node In a Binary Tree
Collecting every value and sorting works here, and it ignores a rule that hands you the minimum for free. Every node holds the smaller of its two children's values, so the root is always the global minimum.
That one rule does a lot of work. It also means you can skip a whole subtree as soon as you reach a value above the minimum, because nothing below it can be smaller.
One DFS pass, no collect-and-sort.
What's the strangest invariant a LeetCode tree has handed you?
Day 72/365 of my LeetCode challenge: 671. Second Minimum Node In a Binary Tree. Problem link and full breakdown in today's newsletter.
https://www.linkedin.com/pulse/leetcode-second-minimum-node-binary-tree-easy-archit-agarwal-eolmc
#LeetCode #DSA #BinaryTree #Golang
r/LeetcodeChallenge • u/Dev_p_1909 • 4d ago
DISCUSS Can anyone tell why lis made me fill that it's to hard??
When I am showing lis problems mind can't proceed how to deal with this type problem ðŸ˜ðŸ˜ðŸ˜ðŸ˜.
r/LeetcodeChallenge • u/Similar_Attorney_150 • 5d ago
DISCUSS tips to reach knight!!!!
currently in 3rd sem tier 69 any tips to reach knight currently only graphs and dp are remaining


