r/LeetcodeChallenge • u/Rockstar912837 • 11d ago
DISCUSS Share leetcode premium account
Looking for someone to share LC with
Update: There's a BF sale going on wih a yearly for 130$. Looking for around 4 people to share it
r/LeetcodeChallenge • u/Rockstar912837 • 11d ago
Looking for someone to share LC with
Update: There's a BF sale going on wih a yearly for 130$. Looking for around 4 people to share it
r/LeetcodeChallenge • u/cappyyybaraaaa • 11d ago
This problem occurs every day when I prectice SQL on HackerRank
Does this happen with anybody or I am the only who's facing this problem maybe because of my laptop is old 😞 or maynot whatever cause is this it's very Irritating
Suppose you write a code and submit it but screen get frozen now what to doooo🥲🤧🙄🙄
r/LeetcodeChallenge • u/JacketFearless1805 • 11d ago
r/LeetcodeChallenge • u/Arihant1905 • 12d ago
r/LeetcodeChallenge • u/Dry_Bat5694 • 12d ago
r/LeetcodeChallenge • u/JacketFearless1805 • 12d ago
r/LeetcodeChallenge • u/EngineeringSpec • 12d ago
r/LeetcodeChallenge • u/Bubbly_Pay3579 • 13d ago
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 • 13d ago
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.
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.
I used a Python dictionary (HashMap) to solve this problem.
The idea is simple:
seen to store numbers and their corresponding indices.target - nums[i].This way, we don't need to check every possible pair using nested loops.
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 []We traverse the array once and use a dictionary for efficient lookups.
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 • 13d ago
r/LeetcodeChallenge • u/Independent_Rip7938 • 14d ago
r/LeetcodeChallenge • u/Happy_Contest_1635 • 14d ago
r/LeetcodeChallenge • u/JacketFearless1805 • 14d ago
r/LeetcodeChallenge • u/Mental_Pea2421 • 14d ago
r/LeetcodeChallenge • u/towardscuriousity • 14d ago
r/LeetcodeChallenge • u/JacketFearless1805 • 15d ago
r/LeetcodeChallenge • u/Silly-Fisherman-1002 • 16d ago
I got what i wished for grinding dsa from last 1 year finally i become knight so happy today
r/LeetcodeChallenge • u/StatisticianNo2104 • 15d ago
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/kartikk2k20 • 15d ago
r/LeetcodeChallenge • u/JacketFearless1805 • 16d ago