Skip to content

Tags

#leetcode

Posts tagged #leetcode on Dynamo Geeks: 10 posts from the community, most useful first.

10 posts

Posts tagged #leetcode

  1. Question

    CF Expert but bombed my first real interview. interviewer said 'communication'. what does that even mean for a coding round?

    ok so. codeforces expert (1680), ICPC regionals twice. first internship interview yesterday, dhaka product company, panel was remote from singapore. problem was a medium graph thing. had the idea in 2 min, coded it in 8, passed all their cases. feedback today: "strong problem solving, weak communication, no hire." bro WHAT. i solved it. faster than anyone they've probably seen. what do they want, a ted talk? also…

    Mahin Hasan9likes11comments

  2. Article

    Read the constraints first: how I pick the pattern in under 2 minutes

    Most people read the story in a problem and skip the constraints. The story is decoration. The constraints tell you the complexity you are allowed, and the complexity tells you the pattern. This is the routine I use, and the one I have been teaching in mocks for six years. Step 1: constraints → your budget Rough rule: a judge does about 10^8 simple operations per second in C++ or Java. So: n ≤ 20 : exponential is…

    Nikhil Sharan111likes35comments

  3. Article

    Binary search on the answer: when nothing is sorted but you can still binary search

    Students learn binary search as "find x in a sorted array" and then get stuck on questions where nothing is sorted. The trick is that you are not searching the array. You are searching the answer . The problem You have packages with weights w[i] that must be shipped in order. A ship carries them over D days, loading packages in order each day until the next one would exceed its capacity. What is the minimum capacity…

    Nikhil Sharan40likes9comments

  4. Article

    DSA is not useless for real jobs. Grinding 800 questions without revision is.

    Every few weeks the same fight starts in my comments. One side says DSA is useless because "real jobs are CRUD". The other side says you are not an engineer if you cannot invert a binary tree on a whiteboard. Both sides are a little right and mostly loud. Let me give the boring answer with examples. Where DSA showed up in real work A nightly job deduplicating 2 million customer records with List.contains() inside a…

    Nikhil Sharan28likes19comments

  5. Article

    Monotonic stack, explained with a queue at a chai stall

    Problem: for every element in an array, find the first element to its right that is greater than it. If none, -1. Brute force: for each i, scan right until you find something bigger. O(n²). With n = 10^5 you are done for. The chai stall Imagine people standing in a line outside a chai stall, all looking to the right. Each person wants to know: who is the first person to my right who is taller than me? Walk along the…

    Nikhil Sharan37likes8comments

  6. Article

    Two pointers is not one trick. It is three shapes.

    Every week someone messages me "bhaiya two pointers samajh aata hai but question mein apply nahi hota". That happens because people learn it as one trick. It is actually three different shapes, and the problem statement tells you which shape it wants if you read it slowly. Shape 1: opposite ends, moving inward Signal: the array is sorted (or you are allowed to sort it) and you want a pair with some property. Classic…

    Nikhil Sharan19likes9comments

Get the best of Dynamo Geeks weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.