8 patterns to solve 80% Leetcode problems

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 199

  • @sahilandsarra
    @sahilandsarra  8 місяців тому +33

    Try my free email crash course to crush technical interviews:
    Interview Master (now called InstaByte) - instabyte.io/

    • @TheViral_fyp
      @TheViral_fyp 8 місяців тому +3

      Brother you doing great job 👍 ... But can u suggest me best book fundamental of DSA stuffs in java

    • @vivekcreation1904
      @vivekcreation1904 5 місяців тому

      The link is not working....

  • @congdatt
    @congdatt 8 місяців тому +582

    1. 2 pointer: 6:18
    2. Binary Tree BFS: 5:26
    3. Topological Sort: 4:33
    4. Binary Tree DFS: 3:39
    5. Top K Elements: 2:45
    6. Modified Binary Search: 1:35
    7. Subset: 1:04
    8. Sliding window: 0:17

  • @TeenyPort
    @TeenyPort 8 місяців тому +267

    Wow this video just made me realize A.) how much I forgot since I graduated, and B.) how much I haven’t needed to remember any of this so far in my professional developer career

    • @makima7457
      @makima7457 7 місяців тому +8

      so you mean these doesn't apply to your working experience. I am a student and I saw some competition problems like these and couldn't solve some. Then I thought that what will I do when I got a job?

    • @sidtalks2885
      @sidtalks2885 6 місяців тому

      @@makima7457 Believe me , you won't need any of these

    • @hen56349
      @hen56349 6 місяців тому

      @@makima7457 no, your job doesn't require this. However, it just improves your understanding of coding overall. If you are very good at leetcode, then employers can be confident in you. It shows employers that you have the discipline t to learn any skills required for a job.

    • @rafiashan8389
      @rafiashan8389 6 місяців тому +22

      @@makima7457 These kind of problems improve our problem solving abilities. That's why we learn / practice these pattern. In professional career, there not many situations where you need to use these patterns as there are already templates given. We just need to know how to use them accordingly.

    • @Bladermishal10
      @Bladermishal10 6 місяців тому

      ​@@rafiashan8389exactly but then when you wanna change job this is the kind of questions they ask in interviews, hence why I am here xD

  • @austecon6818
    @austecon6818 4 місяці тому +37

    I am still under 200 problems solved but I think I'm already qualified enough to say that this video is exactly the advice I would give too. The 80/20 rule... that 8 patterns will help you solve about 70% of mediums with the caveat that you DEEPLY understand the patterns and all the possible subtle variations. The other 30% are either different algorithms, tricks / math knowledge, greedy algorithms or DP problems... but most DP problems can be solved well enough with DFS + top-down memoisation.

  • @Brajgamer
    @Brajgamer 7 місяців тому +61

    Its one thing to master solving these problems. But its completely different story when it comes to identify these patterns in real world problems or modelling real issues with these data structures.

    • @svistetsky
      @svistetsky 6 місяців тому +8

      Once you've solved enough of each pattern, you can reduce any given problem to the basis (some "ideal", simple problem).

  • @nadim379
    @nadim379 5 місяців тому +6

    8. 0:16 Sliding Window Pattern
    7. 1:02 Subset Pattern
    6. 1:34 Modified Binary Search Pattern
    5. 2:45 Top k Elements Pattern
    4. 3:40 Binary Tree DFS Pattern
    3. 3:34 Topological Sort Pattern
    2. 5:25 Binary Tree BFS Pattern
    1. 6:18 Two Pointer Pattern

  • @the-real-dr2050
    @the-real-dr2050 7 місяців тому +9

    Several great easy takeaways from this video and I’ve only watched it once. I’ll implement bisect left and right in swift now lol. Love it, thanks

  • @BrownStain_Silver
    @BrownStain_Silver 7 місяців тому +3

    I just discovered your channel after 4 months in a basic Python and intro to data science. During the course, I've written a few programs to automate tasks at work. I'm deciding where to go next and the most efficient way to get there. This channel is awesome! It has put so much into the right context to make the next decision.

  • @habibalnoman845
    @habibalnoman845 8 місяців тому +28

    happy to see you, love from Bangladesh ❤

    • @Bladermishal10
      @Bladermishal10 6 місяців тому

      Are you a software engineer in Bangladesh?

  • @Shhhh-ni5jw
    @Shhhh-ni5jw 8 місяців тому +19

    I practices a lot of leetcode but my brain feels frozen right now and I cannot write any code even if I know the approaxh

  • @lakshmi8347
    @lakshmi8347 7 місяців тому +60

    This video is mind-blowing !!!
    Sir, Why don't you start a series on each pattern???
    It would be useful for everyone even though it is paid 🙏

    • @avinashkumar3116
      @avinashkumar3116 6 місяців тому +1

      Striver has already made series on each pattern with problems.
      Check it out on his channel #takeUforward, course name - Strivers A2Z DSA Course.
      He is the best.

  • @chandup832
    @chandup832 5 місяців тому +1

    can you share list of problems in each pattern to practice? That would be very helpful, Thanks

  • @Marcusparker-vu4pr
    @Marcusparker-vu4pr 25 днів тому

    Life changing video ❤

  • @dasariasritha7974
    @dasariasritha7974 2 місяці тому

    Hi, I really admire your content which is unique and worth, could please make sure that after every new method maintain few seconds time so that we can process it. Actually your words have clarity only transition of topics need a little gap

  • @anamikakumari3879
    @anamikakumari3879 8 місяців тому +20

    It would be great if you could share curated questions list for each pattern for practice

  • @ranihirani
    @ranihirani 3 місяці тому +1

    I'm so gonna consume these patterns into my soul.

  • @SaitejaE
    @SaitejaE 8 місяців тому +4

    Thanks for useful content!!

  • @navin_thomas
    @navin_thomas 6 місяців тому

    Thanks for providing the advice regarding the bisect module functions.

  • @YashTrivedi-iq3ft
    @YashTrivedi-iq3ft 8 місяців тому +72

    Bro speaks in Lowercase

    • @arvindgb7995
      @arvindgb7995 Місяць тому

      😂 dang I lol'd so hard. His chill is unbeatable yeah.

  • @jonathanjohnson2785
    @jonathanjohnson2785 8 місяців тому +2

    Too valuable. Thanks Sahil❤

  • @thanhn2001
    @thanhn2001 4 місяці тому

    Thank you such a great video that doesn't take 1 hour.

  • @J4RMAMS
    @J4RMAMS 7 місяців тому +1

    I love you Sahil!!! Your journey inspired me to apply for a masters in computer science at Northeastern University!!!

  • @srinivaschaligeri5760
    @srinivaschaligeri5760 8 місяців тому +2

    I am always looking for your new videos ❤

  • @md_pedia1
    @md_pedia1 8 місяців тому +2

    That was really insightful ❤

  • @juq6971
    @juq6971 3 місяці тому

    this video is only useful for those that have already solved enough of those Leetcode problems

  • @Mwme2000
    @Mwme2000 5 місяців тому +2

    Can you please tell me if it is important to slove competitive programming questions ? Is it important to my career. I am good at coding and problem solving but don't slove hard questions

  • @TastieFoodHyderabad
    @TastieFoodHyderabad 2 місяці тому +2

    How do you create such animations?

  • @Allthingslearningg
    @Allthingslearningg 21 день тому

    I feel he should have mentioned the 2 pointer pattern at the top as the first pattern

  • @pawelsubko7277
    @pawelsubko7277 7 місяців тому +11

    More like 40%, to solve another 50% to be at the desired 90% you need only 35 more patterns.

  • @MrTubeyoucomment
    @MrTubeyoucomment 7 місяців тому +9

    As someone commented earlier - Bro talks in lowercase 🤣🤣🤣

  • @shanthim2573
    @shanthim2573 8 місяців тому +1

    Good effort bro

  • @pvibe-re3rt
    @pvibe-re3rt 6 місяців тому

    Greater explanation

  • @raghavbakshee9307
    @raghavbakshee9307 4 місяці тому +22

    Bro speaks in lowercase

  • @syedsaad4160
    @syedsaad4160 8 місяців тому +2

    Hashmap is pretty important too

  • @gowthammyil
    @gowthammyil 8 місяців тому

    Great knowledgeable video❤

    • @01_abhijeet49
      @01_abhijeet49 8 місяців тому

      You have to implement it too

  • @jotrades26
    @jotrades26 6 місяців тому +1

    Highly misleading, came to see patterns but saw generic DS& Algo script , patterns are there, what matters is the patterns that build from intuitions not concepts

  • @mdyusufansari8897
    @mdyusufansari8897 8 місяців тому +5

    please make complete courses on devops, cloud computing.

    • @Simple_OG
      @Simple_OG 8 місяців тому +2

      Stop watching courses do something with yourself

    • @carl.bergmann
      @carl.bergmann 8 місяців тому

      @@Simple_OG I disagree, doing something yourself if good for reaching "depth" like a path in a DFS. Doing a course/reading a book is like a BFS in a given domain. It gives you the overview and wires the concepts together. So, you need both.

  • @MADA_QWE
    @MADA_QWE 8 місяців тому +1

    I am taking CS50, Introduction to Programming with Python. Sometimes, when I try to solve problems, I can't figure them out. I might understand the logic, but struggle with implementing it. After attempting to solve the problem myself, I often have to look at the solution. When I do, I understand it. Does this mean I'm a bad programmer, or that programming isn't for me?

    • @youtubeuserwhowatchesyoutube
      @youtubeuserwhowatchesyoutube 8 місяців тому

      same bro same....i feel like iam working so hard for nothing🥲

    • @anihadagali4725
      @anihadagali4725 8 місяців тому +2

      It's always Ok to look at the solutions. But Make sure you understand the solution. But do revisit the problem the try solving it again, this time maybe chose a different language (any lang works, it's good to know more languages).

  • @Lalalala22537
    @Lalalala22537 8 місяців тому +1

    Are you a front-end / back-end developer or something else?

  • @nikitarao9617
    @nikitarao9617 4 місяці тому

    Which is the best course to learn DSA and their time complexities?

  • @SenthilkumarDeivasigamani
    @SenthilkumarDeivasigamani 8 місяців тому +1

    Thank you Sahil ❤

  • @SridTech
    @SridTech 8 місяців тому +2

    I subscribed to the interviewmaster mailing list. But no mail is delivered.

  • @dhirajvanarase4331
    @dhirajvanarase4331 7 місяців тому

    Please make a video on Salesforce Developer path

  • @ayushtiwari6473
    @ayushtiwari6473 8 місяців тому

    Prefix array, hashing are add-on

  • @akshayar5993
    @akshayar5993 7 місяців тому

    How to learn to solve subset and substring problems? Can you please guide

  • @CodingWorldHere
    @CodingWorldHere 8 місяців тому +3

    Hard to digest in 8 minutes make detailed video.

  • @045sunilkumar2
    @045sunilkumar2 8 місяців тому +2

    Please tell us about how to start leetcode for beginners

  • @himanshumishra6243
    @himanshumishra6243 7 місяців тому

    good video bro..could you please suggest me DSA course for golang

  • @RahulChauhan-0907
    @RahulChauhan-0907 8 місяців тому

    Sir, I am a data science enthusiast I have covered all the mathematics behind machine learning, practice the implementation and did same for deep learning also.
    I started NLP please guide me towards this role I want to get a good job this placement season it will start later this year kindly guide

  • @priyankashettigar4475
    @priyankashettigar4475 8 місяців тому

    Can you please tell how to improve logical and critical thinking skill??

    • @NatureNourisher
      @NatureNourisher 8 місяців тому

      Hai.you should solve sudoku and logical problems which are available free on internet

    • @hamza_dev
      @hamza_dev 8 місяців тому

      By practicing.

  • @madhvishrivastava3646
    @madhvishrivastava3646 8 місяців тому

    Hi Sahil...sometimes I feel difficulty in thinking logic...I think it will improve over time by solving many problems. I don't know if I am right ?

  • @dhirajvanarase4331
    @dhirajvanarase4331 8 місяців тому

    Can you please make video on Salesforce developer path.

  • @jaihindjaiswar5880
    @jaihindjaiswar5880 5 місяців тому

    i love your videos😍

  • @galanoth17
    @galanoth17 6 місяців тому +1

    Suprised DP patterns is not on the list.

  • @sachinreddy2836
    @sachinreddy2836 8 місяців тому

    Nice video❤

  • @SS-lg8fc
    @SS-lg8fc 8 місяців тому

    Finally you've uploaded a video

  • @SDGful
    @SDGful 3 місяці тому

    please should learn DS and algo to build big stuff and give it to open-source problem with Indian developers learn DS just to crack interviews thats why there is no Indian big open source community which has build some extreme stuff like Database, streaming solution, or compilers or anything not even a framework

  • @i_youtube_
    @i_youtube_ 8 місяців тому

    Which software do you use for animation?

  • @md.nahidulalamchowdhury9568
    @md.nahidulalamchowdhury9568 5 місяців тому

    Thanks a lot.

  • @anilhanumantharao9144
    @anilhanumantharao9144 8 місяців тому

    Thank you❣

  • @neerajsinghbisht4030
    @neerajsinghbisht4030 8 місяців тому +4

    People from India 🎉

  • @Kaviarasu_S
    @Kaviarasu_S 8 місяців тому

    can you please share tools used to create these content

  • @vishwaroop1431
    @vishwaroop1431 3 місяці тому

    bro whats difference betn 2 pointer and a sliding window

  • @kishorpustake6682
    @kishorpustake6682 28 днів тому

    I can't think logic of an easy leetcode problems can't solve a single easy leetcode problem till now from 2 years I m learning 😖😖😖

  • @NavdeepVarshney-ep4ck
    @NavdeepVarshney-ep4ck 6 місяців тому

    Sor I want to know is currently there scope in the industry because there is massive layoff please help me I have to prepare.

  • @ReshmaShaik-zi9rz
    @ReshmaShaik-zi9rz 8 місяців тому

    Bro can u make a video on doing a project on git hub for beginners plss

  • @sabbirhossan3499
    @sabbirhossan3499 8 місяців тому

    Sir I didn't understand leetcode problem what can do please help.

  • @rahulkumar11a98
    @rahulkumar11a98 8 місяців тому

    Should we do DSA in JavaScript

    • @nofeah89
      @nofeah89 8 місяців тому +1

      Can do in any language JS is popular because its the backbone of web

  • @foundry1534
    @foundry1534 7 місяців тому

    я удивлён тем, что много чего из этого списка есть в ЕГЭ

  • @abdullahalrafi101
    @abdullahalrafi101 8 місяців тому

    Thank you.....🔥🔥🔥

  • @aj-lan284
    @aj-lan284 7 місяців тому

    you inspired me sahil. btw how did you get 300K package? is it your negotiation skills or due to COVID you got a high package? please tell me

  • @1234567qwerification
    @1234567qwerification 6 місяців тому

    What about UnionFind?
    Is it in the topological sorting?

    • @arvindgb7995
      @arvindgb7995 Місяць тому

      what no that's totally different

  • @vedparkashgaba5478
    @vedparkashgaba5478 8 місяців тому

    Valuable video

  • @fahmidzaman
    @fahmidzaman 8 місяців тому

    I want to be an AI engineer which topics should i learn durinh my BSC beside DSA

  • @BrainyQuizZone
    @BrainyQuizZone 8 місяців тому

    I am bigger python can i join your course are not

  • @funnycartoons707
    @funnycartoons707 8 місяців тому +3

    Love from IIT Delhi jwala hostel

  • @BhoomikaD-r4l
    @BhoomikaD-r4l 4 місяці тому

    Me after listening to him: may be bro is very serious person in life
    Me after seeing thumbnail: may be not 🤔

  • @samplewebinar5783
    @samplewebinar5783 5 місяців тому

    But the patterns will have subpatterns

  • @georgerussel
    @georgerussel 7 місяців тому

    Where is DP?

  • @hlearningkids
    @hlearningkids 7 місяців тому

    Very good

  • @pawanterdal2261
    @pawanterdal2261 8 місяців тому

    What about dynamic programming and graphs ?

  • @Artsbyaishwarya
    @Artsbyaishwarya 8 місяців тому

    Good for revision

  • @williejohnson3692
    @williejohnson3692 5 місяців тому

    Subscribed but no email..

  • @MRsajib-ht4ff
    @MRsajib-ht4ff 8 місяців тому

    your voice awesome

  • @technology_planet2024
    @technology_planet2024 8 місяців тому

    The legend!

  • @genzhustler1234
    @genzhustler1234 8 місяців тому +2

    I am from a very small village in Bihar. I am 19 years old and I don't even know how to operate a computer. Can i became a good software engineer?

  • @lordadamson
    @lordadamson 6 місяців тому

    thanks a lot

  • @qwerttest3550
    @qwerttest3550 8 місяців тому

    Hi Sahil, can I know if your running any consultancy for outside India jobs of so can you provide me the details

  • @imPriyansh77
    @imPriyansh77 8 місяців тому

    Thank you Sir

  • @ayushagarwal3864
    @ayushagarwal3864 7 місяців тому

    All this is good until DP and Graphs come into play :P

  • @omkarsawant1167
    @omkarsawant1167 7 місяців тому

    bro is like sidhi baat no bakwas

  • @pioneerx9066
    @pioneerx9066 5 місяців тому

    DP is no tmentioned?

  • @esrx7a
    @esrx7a 8 місяців тому

    Thank you Sahil anna

  • @zaidkhan-rx4bb
    @zaidkhan-rx4bb 8 місяців тому

    Amazing

  • @Kode_with_Koushik
    @Kode_with_Koushik 8 місяців тому

    Bhai sahil , aap thora dheere bola karo yaar... saans lo bich mein.
    Itna tez bolte ho matha ke upaar chala jata hai.
    Aap woh creator ho jisko 0.25x mein dekhna padta hai

  • @iseeflowers
    @iseeflowers 6 місяців тому

    Didn’t know topological sort is important.

  • @Channel-j8w
    @Channel-j8w 7 місяців тому +1

    6:18

  • @vanshraj4724
    @vanshraj4724 7 місяців тому

    where's dynamic programming? 💀

  • @Naam_nahi_hai
    @Naam_nahi_hai 8 місяців тому

    Sir Maine Ise kiya hai

  • @aadigupta3639
    @aadigupta3639 3 місяці тому

    catcha is nt working