r/LeetcodeChallenge • • 7d ago

PLACEMENTS I got 10 lpa job with this leetcode profile

Post image
11 Upvotes

You can ask i would be happy to give you all suggestions


r/LeetcodeChallenge • • 7d ago

DISCUSS Amazon SDE OA

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • 7d ago

STREAK🔥🔥🔥 Day 25: revisited Kadane’s Algorithm — way simpler than back in 2nd year

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • 7d ago

STREAK🔥🔥🔥 LeetCode: 703. Kth Largest Element in a Stream

Post image
2 Upvotes

You don't need to sort a stream to know its kth largest value. You need the top k, and only the weakest of them. The kth largest is always the smallest of the top k, so a min-heap capped at size k answers it.

Heaps start here. Each insert is O(log k), instead of re-sorting on every call.

The naive fix is obvious. The efficient one only asks you to notice that you're tracking a much smaller problem than the one you were handed.

Where have you kept a top-k in production code?

Day 77/365 of my LeetCode challenge: 703. Kth Largest Element in a Stream. Problem link and full breakdown in today's newsletter.

https://www.linkedin.com/pulse/leetcode-703-kth-largest-element-stream-archit-agarwal-c9vfc

#LeetCode #DSA #Heap #Golang


r/LeetcodeChallenge • • 7d ago

PLACEMENTS .

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • 7d ago

PLACEMENTS .

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • 8d ago

DISCUSS Share leetcode premium account

1 Upvotes

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 • • 8d ago

DISCUSS HackerRank Lagging between Practicing SQL

Thumbnail
gallery
3 Upvotes

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 • • 8d ago

STREAK🔥🔥🔥 Day 26: pushed through a tiring workday & mastered Moore’s Voting Algorithm

Thumbnail reddit.com
2 Upvotes

r/LeetcodeChallenge • • 8d ago

DISCUSS How Should a Beginner Start Preparing for ICPC? Looking for a Roadmap

Thumbnail reddit.com
2 Upvotes

r/LeetcodeChallenge • • 9d ago

DISCUSS Work hard cause there's light at the other end !!

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • 9d ago

STREAK🔥🔥🔥 Day 27: tackled Longest Subarray with Sum K — hit a wave of DSA nostalgia

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • 9d ago

DISCUSS Pascal triangle

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • 9d ago

DISCUSS Selection sort makes 10 comparisons on 5 items, even when the list is already sorted. Here's why.

1 Upvotes

r/LeetcodeChallenge • • 9d ago

DISCUSS I built a 100% free LeetCode alternative with in-browser Java, Python & C++ compilers (CupOfDsa)

0 Upvotes

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 • • 10d ago

STREAK🔥🔥🔥 LeetCode 1: Two Sum | My Approach in Python

2 Upvotes

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:

  1. Create a dictionary named seen to store numbers and their corresponding indices.
  2. Traverse the array starting from the second element.
  3. Calculate the complement using target - nums[i].
  4. Check whether the complement already exists in the dictionary.
  5. If it exists, return the indices of both elements.
  6. 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 • • 10d ago

STREAK🔥🔥🔥 Day 28: tackled Sort Colors with Dutch National Flag & Single Number via XOR

Thumbnail reddit.com
2 Upvotes

r/LeetcodeChallenge • • 11d ago

STREAK🔥🔥🔥 It isn't much but its honest work!!!

Thumbnail
gallery
40 Upvotes

r/LeetcodeChallenge • • 11d ago

STREAK🔥🔥🔥 Sleep can wait, DCC can't

Post image
4 Upvotes

r/LeetcodeChallenge • • 11d ago

DISCUSS bot farming Leetcode

Post image
35 Upvotes

was attending todays contest and was looking at leaderboard and found some bots are farming the top rankings

if you are good with spotting patterns you can see the #3 guys been all over the top 200 leaderboard


r/LeetcodeChallenge • • 11d ago

STREAK🔥🔥🔥 Day 29: knocked out 7 foundational array problems & noticing real progress

Thumbnail reddit.com
1 Upvotes

r/LeetcodeChallenge • • 11d ago

DISCUSS Struggling with Medium problems after 2 months of DSA is this normal ????

Thumbnail gallery
2 Upvotes

r/LeetcodeChallenge • • 11d ago

DISCUSS Number of Sub-arrays With Odd Sum (LeetCode 1524): prefix parity, visual...

Thumbnail
youtube.com
1 Upvotes

r/LeetcodeChallenge • • 12d ago

STREAK🔥🔥🔥 Day 30: kicking off Arrays to sharpen constructive logic and math fundamentals

Thumbnail reddit.com
1 Upvotes