LeetCode is a JOKE with This ONE WEIRD TRICK

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • 🔥 How to know which algorithm to use to solve a LeetCode problem or a HackerRank online assessment? Simply use the time constraints to infer the intended time complexity and the algorithm. Learn more: algo.monster/p...
    This video tutorial will help you systematically approach and quickly solve LeetCode easy, medium, and hard problems. Ideal for beginners and experienced coders alike. It's the Ultimate Leetcode interview tip. LeetCode tips and tricks.
    Our unique approach emphasizes learning to solve problems by leveraging the constraints in the problem description. With this trick, you can back-calculate time complexity and select the best algorithm for your solution.
    Get ready to immerse yourself in a journey of practical LeetCode learning, where we aim to help you master the art of solving coding problems. From tips and tricks to in-depth walkthroughs, this video is your one-stop resource for LeetCode mastery.
    Don't forget to subscribe and hit the bell for notifications on our upcoming content. Join us in this learning journey and become a LeetCode champion!
    #LeetCode #LeetCodeProblems #CodingChallenge #Algorithm #DataStructures #DSA #Programming #Hackerrank #codinginterview #leetcodetips

Комментарии • 69

  • @algo.monster
    @algo.monster  Год назад +5

    Full constraint to algo mapping and code examples here: algo.monster/problems/runtime_summary

  • @ohmegatech666
    @ohmegatech666 6 месяцев назад +82

    This is a pretty genius way to start approaching algo problems because it's way easier to look at constraints to determine the required time complexity than it is to look at the problem description and determine what algorithms or data structures fit

    • @algo.monster
      @algo.monster  6 месяцев назад +3

      Thanks! Yes, it is, indeed!

  • @TheRn35
    @TheRn35 Год назад +67

    Goodhart's Law is expressed as: “When a measure becomes a target, it ceases to be a good measure.”
    But, I guess, it is what it is.

    • @algo.monster
      @algo.monster  Год назад +16

      hahaha, yes indeed. LeetCode-style interviews is just a game we have to play to get in the door.

  • @RJ-ko3ln
    @RJ-ko3ln 13 дней назад +86

    You guys didn’t know this ??

    • @sadboy-xx6gh
      @sadboy-xx6gh 9 дней назад +29

      Well if you knew, you wouldnt be watching this video now, would you?

    • @rahulbasetti700
      @rahulbasetti700 8 дней назад

      😂😂😂😂😂😂😂​@@sadboy-xx6gh

    • @yagnikbose8973
      @yagnikbose8973 7 дней назад +1

      ​@@sadboy-xx6ghha got 'em!

    • @mr.rabbit5642
      @mr.rabbit5642 7 дней назад

      ​@@sadboy-xx6gh obviously. We also never buy a kinder surprise eggs with a toy we already have!
      Fr tho, people getting IT jobs should know this from a fucking college, among other fundamentals. Not as a 'crazy hack' for code monkeys to ace leet code...

    • @pushkarroy9740
      @pushkarroy9740 6 дней назад +4

      Yeah how can you not see the pattern of time limit exceed and constraint

  • @raghavbagdi87
    @raghavbagdi87 2 месяца назад +26

    Damnnnnn, this is soooooo underrated man. Love such insights! Keep em coming

    • @algo.monster
      @algo.monster  Месяц назад +2

      Glad it helps! And Zlatan is the best haha

  • @algo.monster
    @algo.monster  9 дней назад

    Check this video to understand how LeetCode (or Hackerrank etc) works behind the scene: ruclips.net/video/hRnJxPeoZyg/видео.html

  • @umeshhbhat
    @umeshhbhat Час назад

    But the issue with this approach is that in the onsite interview, interviewer won't tell you the constraints. You need to find out the most optimal approach based on the problem description not the constraints.

  • @thepathakarpit
    @thepathakarpit 8 дней назад +3

    Thank you for teaching the first concept you need to learn before starting Competitive Programming but people are so dumb they don't pay attention to even that one

  • @KuaisArts
    @KuaisArts Год назад +5

    It's hard coming up with what specific class of algorithms I should use :( This way is definitely useful if you ask for constraints!

  • @1234victorxD
    @1234victorxD 3 месяца назад +8

    Dude that was really smart wtf

  • @nbansal
    @nbansal 6 дней назад +4

    What's the point of this. You are not solving LeetCode problem to game their system. You are trying to prepare for the interviews mostly or at least I am. So even though the platform accepts quadratic or even exponential solution, what's the point of it. Interviewer will obviously expect a better solution.

    • @algo.monster
      @algo.monster  6 дней назад +5

      To quote the classic math book "How to Solve It" by George Pólya:
      "The conditions of the problem contain the essential data. If you analyze the conditions carefully, they will suggest the way to the solution."
      This is exactly how you are supposed to solve a problem - using whatever information you have in the problem description. This is not gaming the system. You need this knowledge to deduce what to do next. A reasonable interviewer will understand this. If not, you probably don't want that job anyways cuz they are probably not good engineers or collegues.
      Also LeetCode is usually stricter than real interviews. If you can solve it to pass LeetCode, you can pass the interview.

  • @HusnaKhanam-bm4fq
    @HusnaKhanam-bm4fq 7 месяцев назад +2

    was much needed !!!!

  • @i_youtube_
    @i_youtube_ 11 дней назад +2

    I want to understand how code is executed and how does LeetCode measure the best solutions? Anybody can list some technical concepts I need to learn?

    • @algo.monster
      @algo.monster  10 дней назад +1

      Check out this video on how leetcode works behind the scene: ruclips.net/video/hRnJxPeoZyg/видео.html

  • @takeuchi5760
    @takeuchi5760 11 дней назад +1

    Yeah noticed this around when I had solved 70 questions.

  • @funnyhilarious123
    @funnyhilarious123 6 дней назад

    Hey, can you make something where more of these constraints or the inputs/language hints us to use specific algorithms, like if its asked minimize the maximum sum, we use binary search or something same like that???

    • @algo.monster
      @algo.monster  6 дней назад +1

      Hey yes, we have a full flowchart on how to determining what algo to use: algo.monster/flowchart

  • @Sridevikrish21
    @Sridevikrish21 3 месяца назад +2

    If the constraints is 5 *10^4
    Using this constraints which time complexity is used and in which approach we have to code

    • @yousafsabir7
      @yousafsabir7 2 месяца назад +1

      Apparently 5*10^4 falls under O(n) or O(nLogn) category

    • @wumi2419
      @wumi2419 6 дней назад

      In video he states that you hit TLE at around 10^7 operations. So anything faster than O(n^1.5), that is O(n) and O(n log n).

  • @caca738
    @caca738 14 дней назад +2

    I always did wonder how to interpret the size constraint, thanks for the helpful video and cheatsheet

  • @milkandhenny
    @milkandhenny 10 месяцев назад +1

    Thanks!

  • @ganeshjaggineni4097
    @ganeshjaggineni4097 3 месяца назад

    NICE SUPER EXCELLENT MOTIVATED

  • @sarthakbehera8324
    @sarthakbehera8324 9 дней назад

    bele bele ta constraints guda deinathae anya online coding platform re. setebele tike sahibaku pade aau. aau interview re ta semane kuhantini. pacharile hi kahibe nale kahibe nahi kichhi constraints. seithi fasi jiba. jie true coder sei karipariba.

  • @Emmap11
    @Emmap11 10 месяцев назад

    Great video!!!

    • @algo.monster
      @algo.monster  10 месяцев назад

      Thanks! Glad you liked it!

  • @user-sy4zo9fu1n
    @user-sy4zo9fu1n 7 месяцев назад

    Found best one❤

  • @Rudra0x01
    @Rudra0x01 7 месяцев назад

    Very informative

  • @kavascgjmd5790
    @kavascgjmd5790 10 дней назад

    i thought u will go to inspect element change the constraints or test case something so that anything might work

    • @algo.monster
      @algo.monster  9 дней назад

      User-submitted code is run on the server so it wouldn't work. But I like the way you think!! haha

  • @wasd3108
    @wasd3108 9 месяцев назад +1

    well that whale should have a full on clown costume and makeup. Because wherever the code is being tested at, the results are a joke XD

  • @erickjhormanromero6905
    @erickjhormanromero6905 6 дней назад

    Yeah. That's really good.

  • @amartyadandapat9366
    @amartyadandapat9366 17 дней назад

    This video is a GEM.

  • @immrhrr
    @immrhrr 2 месяца назад

    Nice❤

  • @s8x.
    @s8x. 3 месяца назад +1

    genius

  • @pamelapang9913
    @pamelapang9913 Год назад +2

    👍👍👍

  • @48_subhambanerjee22
    @48_subhambanerjee22 12 дней назад +1

    Love from india

  • @Harshit-ju2iz
    @Harshit-ju2iz 12 дней назад

    This is HUGE!!!!!!!

  • @sharthakghosh970
    @sharthakghosh970 12 дней назад +1

    This doesn't work all the time, cause there is a statistical aspect too that's taken into consideration. If more and more submissions are in O(n) rather than O(nlogn), your submission will be declined even if it was accepted before.

    • @fakenullie
      @fakenullie 6 дней назад

      It doesn't work this way, but there's a probalistic element (I guess it depends on runner to which your submission is assigned and its load). So sometimes you can try to resubmit the same solution to pass

    • @algo.monster
      @algo.monster  6 дней назад

      I don't think that's how it works. Timing is not dynamic adjusted. Like @fakenullie said the same solution could have different runtime. It's not stable. This is from my friend who worked as ops for LeetCode.

    • @sharthakghosh970
      @sharthakghosh970 6 дней назад

      @@algo.monster I faced this with a few questions. When I attempted to submit the same code two years later it just kept failing. Also problems also change from hard to medium. I was watching some video by neet ode, where in the video it was hard but the problem in the site was a medium. I presumed that as acceptances increased, it changed

  • @allentsai1982
    @allentsai1982 Год назад

    thx alot

  • @scott5227
    @scott5227 7 дней назад

    These are basic things.

  • @dennis3648
    @dennis3648 18 часов назад

    I'm sitting here, watching AI generated content

    • @algo.monster
      @algo.monster  16 часов назад

      haha, using voice clone cuz it's easier to sync the audio with video. the content is all original

  • @dough-pizza
    @dough-pizza 5 дней назад

    I dont think the aim is to just pass the leet code question. Typically if you use brute force in an interview the interviewer would just ask you "is there any other way to solve this?" And if brute force is all that you did its not going to end well

    • @algo.monster
      @algo.monster  4 дня назад

      which is why you need to ask the constraint? a big part of an engineer's job is choosing the right tool for the right job.

  • @zerrickb58
    @zerrickb58 4 месяца назад +1

    nerd

  • @SuperMaDBrothers
    @SuperMaDBrothers Год назад +4

    This is true, but useless.

    • @algo.monster
      @algo.monster  Год назад +1

      can you elaborate? figuring out the algo is half the battle

    • @patrickbateman3912
      @patrickbateman3912 11 месяцев назад +2

      this is absolutely useful. not fully but looking at the constraints your 1/4th work is done

    • @automata-mw2el
      @automata-mw2el 9 месяцев назад

      it's literally a binary search technique for the algorithm matching