MY ULTIMATE LEETCODE TRICKS

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 226

  • @PIRATEKINGDOM
    @PIRATEKINGDOM  2 роки тому +36

    📝 PK'S LEETCODE CHEAT SHEET 👉 piratekingdom.com/leetcode
    ▶ How to Use LeetCode Effectively 👉 ua-cam.com/video/a-thH9a9_XE/v-deo.html

    • @thedevguild7525
      @thedevguild7525 2 роки тому +2

      Wow you even have your own site! What tech stack you code it with?

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому +3

      @@thedevguild7525 squarespace website builder! ;)

    • @mrKnown01
      @mrKnown01 2 роки тому

      Hey bro well I wanted to know if you intentionally put this channel name as Pirate King because basically Pirates have a CAPTAIN.

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому +2

      @Anonymous I'm a One Piece fan

    • @mrKnown01
      @mrKnown01 2 роки тому

      @@PIRATEKINGDOM I got just now to know about this anime. So what's your TREASURE for which you started journey?
      Only if interested.

  • @TonyDiCroce
    @TonyDiCroce 2 роки тому +32

    C++ has deque too. Also leftmost binary search is lower_bound() in c++.

  • @mr.fabulous5165
    @mr.fabulous5165 2 роки тому +11

    Hey Daniel, thank you for you advice, I tried ask people online, more specifically on Stack overflow. It takes me a little bit time to figure out the right format of how to post a question a stack overflow. But once i did it just blow my mind that how fast other programer replied me and literally faster than asking my classmate or tutors! Thank you for letting me to pick your brain again! Really happy to have such strong tool in my toolbox now and you deserve 1 million subs!

  • @darkdudironaji
    @darkdudironaji 2 роки тому +9

    I am about to graduate and needed this so bad. Thank you so much!

  • @keshavakumar9828
    @keshavakumar9828 2 роки тому +8

    I have been following your advice for practising leetcode for the last 4 months, and it's working wonderfully for me. Thank you for this short-hand guide, will use it for future problem solving.

  • @david-hasselhoff7483
    @david-hasselhoff7483 2 роки тому +4

    Dude, this is the absolute gold of gold. You're the man, thank you so much!!

  • @philbert5838
    @philbert5838 2 роки тому +16

    Your study guide is very timely for me, I was trying to look for something that will help me after failing my interviews. You really inspire me pk! Thanks a lot!

    • @bossysmaxx
      @bossysmaxx 2 роки тому

      I just wrote tets randomly on his video and the guy just replied to it, tf

  • @thedevguild7525
    @thedevguild7525 2 роки тому +32

    Wow, this channel also include educational content, sweet! The explanations not only nail it, but it is also concise and makes tough concept easy to pick up! Though I am not on the lookout for job, been practicing DSA to improve my skillset and at the same time seek some excitement in life!

    • @bossysmaxx
      @bossysmaxx 2 роки тому +1

      I just wrote tets randomly on his video and the guy just replied to it, tf

  • @shotime3241
    @shotime3241 2 роки тому +62

    FYI “leftmost binary search” is actually called a left bisection. Python actually offers a library that does both left and right bisection - though you might not be allowed to use it during an interview

    • @bossysmaxx
      @bossysmaxx 2 роки тому

      I just wrote tets randomly on his video and the guy just replied to it, tf

    • @RuturajZadbuke
      @RuturajZadbuke 2 роки тому +9

      I have interviewed in almost all FAANG companies and many others and am ex FAANG. I assure you that you can use bisect no matter what given you can explain what bisect does and how it does it properly to the interviewing engineer. Same with deque, doesn't matter if the engineer doesn't know what a deque is as long as you can give a 2 to 5 minute overview on deck and why using a deque would be suitable for that specific problem. Interviews are equally about communicating your solutions properly to even folks with non-technical background as you might be required to do this at your real world SWE job.

  • @khoaanh7375
    @khoaanh7375 2 роки тому +4

    That is a rly nice edit, thanks for your effort in this community.

  • @nikeshsingh4787
    @nikeshsingh4787 2 роки тому +3

    Love the channel name. Glad to connect with fellow pirates!!

  • @oanaghicajanucristina
    @oanaghicajanucristina 9 місяців тому +3

    OMG, SUBSCRIBED. the best video ever, and also your website is so useful, with your resources i have hope that i will be accepted to one of the internships i am applying. THANK YOU A LOT!

  • @Rcls01
    @Rcls01 День тому

    LeetCode may be hard, but I have never had to solve any problem that was anything like them, in 15 years of working as a software engineer. It is kind of silly how it's simply about memorizing certain patterns, just so you can land a job at a big tech company, and then it loses it's value. It may still be fun for some people to solve these problems and that's why I am here. Thanks for the content!

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

    The true technical interview savior

  • @nobugaming
    @nobugaming 2 роки тому +8

    You can adapt leftmost to after leftmost by changing m to (l+r+1)//2 and updating l to l=m and updating r to r=m-1. This is useful for finding the first element that fails some condition

    • @bossysmaxx
      @bossysmaxx 2 роки тому +1

      I just wrote tets randomly on his video and the guy just replied to it, tf

    • @sushenjamwal
      @sushenjamwal 2 роки тому

      can you pls explain with example?

  • @leoncvetkovski4679
    @leoncvetkovski4679 2 роки тому +10

    Amazing, thank you so much! I really felt like summaries of the DS&A concepts were missing in the online education space. Super helpful.

  • @carlosx7777
    @carlosx7777 2 роки тому +6

    you are great!!!! i think this will help me a lot, is way more structured than just reading Cracking the coding interview or going without a plan on leetCode

  • @AniruddhaShende-zy7op
    @AniruddhaShende-zy7op 2 роки тому +1

    great video and i am happy that he didn't give false hope to beginners by saying that this is enough for interviews instead he said that this can be kept handy and can be used by a beginner to boost his/her journey of leetcoding !!!!!

  • @chrisw9597
    @chrisw9597 2 роки тому +2

    this is not a gold mine, this is a diamond mine!! Thanks for the cheat sheet!

  • @mmm-ie5ws
    @mmm-ie5ws 9 місяців тому +2

    amazing video, thanks. I subbed so quickly.

  • @ethical-hack
    @ethical-hack 2 роки тому +8

    Thank you for the wonderful Video PK!!!

  • @DamnTimCan
    @DamnTimCan 2 роки тому +2

    Great advice. Thanks for your generosity. Your humour an added bonus.

  • @zahaanmahajan1606
    @zahaanmahajan1606 2 роки тому +1

    get this man a medal.

  • @stanleylinsy98
    @stanleylinsy98 2 роки тому +4

    amazing video. I will be taking data structure and algorithm class in the next 6 months. Content like this will be of great help. Thank you

  • @raniel0511
    @raniel0511 2 роки тому +1

    "No email" "No bullshit like that" won me, I mean I already love your content but it's good to hear that.

  • @enip239
    @enip239 2 роки тому +2

    This video is too good to be like a cheat for preparing leetcode. So many information compress in such one video. Love it.

    • @bossysmaxx
      @bossysmaxx 2 роки тому

      I just wrote tets randomly on his video and the guy just replied to it, tf

  • @Onigirii
    @Onigirii 2 роки тому +4

    Thank you! This is exactly what I need right now

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

    Best ever Quick Tips for Problem Solving with Python anyone needs. No here and there, to the point +1 :)

  • @schan263
    @schan263 2 роки тому +1

    I am not looking for a job now but I still do leetcode almost everyday. Today is Christmas day and I did 1 hard and 1 medium. I like to do leetcode before I play video games. Will do more if I have time later tonight after I played video games.

  • @sw6273
    @sw6273 2 роки тому +3

    ありがとうございます!大変助かります!

  • @hibashi.-.4784
    @hibashi.-.4784 2 роки тому +2

    You are just awesome !!! Thankkk uuu soooo muchhh for sharing this cheatsheet . i'm a second year computer science student , few weeks ago i started to leetcode because of your advices and now am getting better at coding :)

  • @thomashaury6651
    @thomashaury6651 2 роки тому +1

    In a world of swe UA-camrs that are greedy get rich quick scheme pitchers trying to sell you their leetClones (How many algoSomethings are there?) You are a breathe of fresh air. Stay awesome.

  • @궁그그미
    @궁그그미 2 роки тому +1

    영상에 삼색스웻셔츠 보고 혹시 한국인,,? 했는데 맞으시네용! 좋은 정보공유 너무 감사드립니다!

  • @leliarubiano6392
    @leliarubiano6392 2 роки тому +2

    You should make a course for interview's questions you are amazing at explaining complicated things.

  • @taco564
    @taco564 2 роки тому +3

    Thanks for the cheat sheet. It's very helpful!

  • @OwenWu-f9t
    @OwenWu-f9t 9 місяців тому

    it's good to know what data structure to use when, but that's just the beginning and only gets you passing like 1/4 of the test cases. A lot of these hard questions require familiarity with implementation and clever tricks that most people wouldn't think of in an interview. You have to be familiar with the syntax of your language and all its functions and datatypes, etc.

  • @mikhailglazkov6075
    @mikhailglazkov6075 2 роки тому +2

    its my first sem learning dsa with java hope all goes well till end and i get placed at MAANG

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

    Man this was beautiful!! ❤

  • @dawkaka
    @dawkaka 2 роки тому

    I clicked on this video thinking it's just another click bait, but it's actually good very helpful.

  • @ladyv890
    @ladyv890 2 роки тому +2

    Thank you! for the lc help! Also like your sweater :-)

  • @faisalalghamdi2066
    @faisalalghamdi2066 2 роки тому +4

    Thank you so much sir! This is extremely useful.

  • @genjioto
    @genjioto 2 роки тому +4

    Mmmm. Log time. I am taking DS&A at school right now so this video was perfectly timed.
    But seriously, you are the best youtube tutor thus far. Your coding tips in this video alone are phenomenal.
    I hope to see more complex subjects broken down into simple terms (plus good practice tips!) as most videos on youtube just cover the basic stuff and not even explain them like you have.
    Your video was only eight minutes but I came away with a much better understanding of DS&A after watching it! Plus I mainly use Python, Java, and Javascript so thats even more convenient that your code is in Python and Java.

    • @bossysmaxx
      @bossysmaxx 2 роки тому

      I just wrote tets randomly on his video and the guy just replied to it, tf

  • @lazybot71
    @lazybot71 2 роки тому +3

    It's really good PK! ❤❤

  • @HuGzHa
    @HuGzHa 2 роки тому +3

    this is extremely useful, thanks pk ❤

  • @가팔르아이수
    @가팔르아이수 2 роки тому +2

    Maaan that's really amazing.Thanks a lot for all!👏🏻👏🏻👏🏻🆒️😃

  • @english51
    @english51 2 роки тому +2

    Thanks, hopefully will have cpp template soon

  • @cunghocthuattoan7869
    @cunghocthuattoan7869 2 роки тому +3

    Thank you so much!! Appreciate your help!

  • @tilekzholdoshbek726
    @tilekzholdoshbek726 2 роки тому +1

    okay nice start with providing website, im subscribing

  • @Whatthetrash
    @Whatthetrash 2 роки тому +1

    PK, I had a question. I'm using your technique of using a deque for a stack (append, pop), queue (append, popleft) and linked list (append, pop, appendleft, popleft). I'm a bit confused, though. Stack and queue have certain operations associated with them (stack has push, pop and peek and queue has enqueue and dequeue ) -- but what do linked lists have? I haven't been able to find anything linked lists are required to have. So, I have 2 questions please: 1.) Do linked lists have certain expected operations and 2.) Why is a deque the ideal data structure to implement those operations with. If you don't have the time to answer, a point in the right direction would be appreciated. Thanks!

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому +1

      1. I’d say addfirst, removefirst, addlast, and removelast. 2. Deque already has those operations implemented within. It’s not exactly an ideal data structure but a working alternative. Check piratekingdom.com/leetcode

    • @Whatthetrash
      @Whatthetrash 2 роки тому +1

      @@PIRATEKINGDOM Ah, okay. I see. Thanks so much for taking the time to break that down. Much respect! :)

  • @chilly2171
    @chilly2171 2 роки тому +2

    deques cannot be used to replace a linked list. you can't store references with deque and link it with other data structures. it is not possible to remove from the middle of a deque in constant time.

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому

      True, but I talked about it in the limited usage of add/remove first/last which is suffient in most lc problems.

  • @candichiu7850
    @candichiu7850 2 роки тому +2

    Thank you! This is really helpful.

  • @vincent3311
    @vincent3311 2 роки тому +1

    Thanks senpai, im very grateful the person like you is exist lol

  • @DeepakJadiwal
    @DeepakJadiwal 2 роки тому +1

    Good, I also start making this type of video 😊😊😊😊

  • @brijendrasai1513
    @brijendrasai1513 2 роки тому +1

    You're god among men for creating that website

  • @SandraPlamenats
    @SandraPlamenats 2 роки тому +1

    Thank you! You have earned your place in heaven!

  • @Whatthetrash
    @Whatthetrash 2 роки тому +2

    This is awesome! Thank you for this! :)

  • @surya8985
    @surya8985 2 роки тому +1

    Thanks pk 😊 most of the tips u told,I faced them recently and they are very interesting

  • @isma5627
    @isma5627 2 роки тому +1

    The GOAT itself.

  • @RainOnline
    @RainOnline 2 роки тому +40

    im too dumb for this

    • @baref0ot455
      @baref0ot455 5 місяців тому +7

      Such an understandable response 😂
      You seriously just have to grind UNTIL you understand. That’s why it pays so well. Its not impossible, just difficult to grasp - at first. But once you start getting it, you’ll start getting it!

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

      Everyone is dumb at something when they are just starting. The key is to keep asking questions until you finally get that ah ha moment. I remember not knowing how a linked list worked or how to use .next, but I kept asking questions and now it makes as much sense as 2 + 2 = 4. Then just keep building your understanding from there.

  • @joshhitech
    @joshhitech 2 роки тому +1

    I really appreciate the effort you put into this. Thanks a lot!

  • @SAI-kg6bb
    @SAI-kg6bb 2 роки тому +1

    I agree bro, you reflected me in few points.

  • @fraction37
    @fraction37 2 роки тому +5

    You're a good teacher! You should make more videos like this one!

  • @mengisi
    @mengisi 2 роки тому +1

    Request ya, create video approach of TDD (when use and when TDD is bad).

  • @chilly2171
    @chilly2171 2 роки тому +2

    c++ has deque as well. I recommend c++

  • @Shawn.Tanaka
    @Shawn.Tanaka 2 роки тому +1

    Thank you for teaching! Off topic: what brand is that long sleeve? It’s nice!

  • @KartikDargan-wc3bv
    @KartikDargan-wc3bv 3 місяці тому

    @6:45 there's some error i guess with the preorder function, it was calling inorder inplace of preorder while calling recursively :)

  • @darshanjain9658
    @darshanjain9658 2 роки тому +3

    Hey!
    Many people/youtubers/influencers have been suggesting to take up the CS50's introduction to Computer Science by HARVARD UNIVERSITY before entering into college. I would like to take your suggestion if I should go with this course or do something else like learning a language (python) or something like data structures and algorithms, I know CS50 would include it but just wanted to confirm if something else is more important at the moment (high school graduate). And if I should take up the 2nd option please let me know the importance of CS50 if I should take it up in the future...

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому +1

      Cs50 is a good start

    • @darshanjain9658
      @darshanjain9658 2 роки тому

      @@PIRATEKINGDOM Thank you so much! But would you suggest a different way to start?

    • @darshanjain9658
      @darshanjain9658 2 роки тому

      @@abhisheknandann cool..! Thanks a lot!

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

    Thank you so much😊

  • @Dhruvkuku
    @Dhruvkuku 2 роки тому +2

    Your t-shirt look cool pk

  • @21doyourthing
    @21doyourthing 2 роки тому +1

    nice! please do more of these

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

    Thanks man , QuickSelect is necessary for interviews?

  • @jayono7ciwa
    @jayono7ciwa 2 роки тому +1

    Appreciate this Video dude 🔥

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

    I love your hair.

  • @imtheone007
    @imtheone007 2 роки тому +1

    Super helpful video 🔥🔥🔥

  • @MayurrWagh
    @MayurrWagh 2 роки тому +3

    thankyou i am confused between c++ and java decided c++ to start with but after this video I will continue dsa in java and python only
    amazing video
    bring more such tricks video for dsa

  • @sagestudy
    @sagestudy 2 роки тому +6

    Please Teach DSA using Python 3, with your editing it will be fun to learn and grasp the concept.
    And this video is really helpful.

  • @michaeltruong405
    @michaeltruong405 2 роки тому +1

    Super helpful thanks!

  • @mjmikaelson
    @mjmikaelson 2 роки тому +1

    Thank you for sharing!

  • @brajagopalmukherjee1588
    @brajagopalmukherjee1588 2 роки тому +1

    Thanks for this man

  • @darshanjain9658
    @darshanjain9658 2 роки тому +2

    Excellent videos..!
    I have just graduated high school and before going to college I'm really confused on what kind of online courses should I take up... One side of me has an interest in hacking so I took up a course on ethical hacking with python but on the other side I'm not sure if I should take up a career in hacking or software development or so on and I'm really really confused. I would really appreciate if you could let me know what kind of courses I'm supposed to do at this stage.

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому +1

      I suggest you learn how to build websites and taking courses on data structures and algorithms

    • @darshanjain9658
      @darshanjain9658 2 роки тому +1

      @@PIRATEKINGDOM okay thanks a lot...! But then if I'm interested in cyber security in the future will this help me?

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому +1

      @@darshanjain9658 it’ll still help... I believe. Sorry, I’m not a cyber security expert

    • @darshanjain9658
      @darshanjain9658 2 роки тому +1

      @@PIRATEKINGDOM okayyy thanks a lot for the reply :))

  • @SidTrip
    @SidTrip 2 роки тому +1

    Nice video! Subscribed!

  • @thepodfunnel
    @thepodfunnel 2 роки тому +1

    Amazing dude!

  • @egoworks5611
    @egoworks5611 2 роки тому +1

    Great content Sir

  • @meoya_gnauh
    @meoya_gnauh 2 роки тому +2

    Thanks!

  • @Tom4tom199e
    @Tom4tom199e 2 роки тому +1

    TYVMMM it's so neet thanks for the work :3

  • @arturschaefer
    @arturschaefer Рік тому

    Amazing tips! 🚀

  • @ftsvtcaratfacethesun4981
    @ftsvtcaratfacethesun4981 2 роки тому +20

    I use JavaScript. Tried to leetcode. It’s so hard. I don’t even understand the task itself. It’s double hard to understand because English isn’t my tongue language and not event second language, also I’m without tech background. And words like time complexity etc I’m so dizzy. Should learn a lot of things 🥺

    • @CostaKazistov
      @CostaKazistov 2 роки тому +6

      Best way to ease into LeetCode is by first getting some good practice on Codewars and Exercism.
      At least that's what worked for me.
      I was in same situation as you (mostly JS + not a native speaker of English).

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому +10

      JS isn’t the most leetcode-friendly language :(

    • @ftsvtcaratfacethesun4981
      @ftsvtcaratfacethesun4981 2 роки тому +3

      @@CostaKazistov oh thank you for sharing

    • @ftsvtcaratfacethesun4981
      @ftsvtcaratfacethesun4981 2 роки тому +1

      @@PIRATEKINGDOM oh I see. Maybe will try to learn python in the future. Thank you for detailed information and what you shared on your website.

    • @kiko7247
      @kiko7247 2 роки тому +2

      Same situation as you, so I learnt C and Python and I can leetcode with no problem. Honestly, C was what I was missing. JavaScript, as much as I love it, doesn't force you to understand what's going on under the hood, the true meaning of programming and to think like a programmer. My best advice would be learn C or Python, with the free Harvard course "CS50" (intro to computer science), because it blends theory with practice, you can do it at your own pace, and most importantly it is structured. There are assessments and a final project of your choice.

  • @4hmed-2jz
    @4hmed-2jz 3 місяці тому

    thought it was lee kwang-soo for a sec from the thumbnail lmao

  • @kanthikiran5825
    @kanthikiran5825 Рік тому +1

    Oreva Monkey D Luffy, Kaijokuvoni naru othokoda, The website is very helpful

  • @zongxun7118
    @zongxun7118 2 роки тому +1

    Amazing video 😍😍

  • @huytranquang6230
    @huytranquang6230 2 роки тому +2

    Great works

  • @dsa2441
    @dsa2441 2 роки тому +1

    Thanks for the tips, very interesting. Btw what about C++

  • @hoangnguyendinh1107
    @hoangnguyendinh1107 2 роки тому +1

    Can you give some tips on writing Java code short and clean and less bug? I always find my code buggy when doing hard problems like having a lot complex logic

  • @orcaorka
    @orcaorka 2 роки тому +4

    Great video! Quick question though, doesn't a linked list represent all three data structures easily already? Personally I just use append()/insert(0) and pop() for stacks, queues and linkedlists, so I don't really understand why using a deque is better.

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому +4

      Time-complexity wise, no difference. Performance-wise, ArrayDeque is better; I use ArrayDeque personally. Also, for me, the interfaces of a deque, add/remove first/last are easier to remember than append(0), insert, pop, etc. See stackoverflow.com/questions/6163166/why-is-arraydeque-better-than-linkedlist

  • @mr.fabulous5165
    @mr.fabulous5165 2 роки тому +2

    hey Daniel, thank you for sharing this cheatsheet!
    Recently I am leetcoding actively, and you really motivate me a lot! This is the first year of my CS degree, hope I get my first intern by the end of my first year of my degree!
    I saw you actively doing leetcode all year around? why is that? was it because u want to be at the position where you are ready to switch job anytime or that was a hobby to you or both?

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому +2

      Just keeping my skills sharp ;)

    • @mr.fabulous5165
      @mr.fabulous5165 2 роки тому

      @@PIRATEKINGDOM would you like to make a video about how to taking notes for leetcode or just generally for engineering?

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

    Is it "DEQUE" or "De-QUEUE" ?

  • @starbuststream3219
    @starbuststream3219 2 роки тому +2

    Is there a mistake in the Cheat Sheet for preorder and postorder of Binary Tree Traversals in Python?

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому

      ??

    • @starbuststream3219
      @starbuststream3219 2 роки тому +1

      @@PIRATEKINGDOM For preorder it's val -> left -> right, but you wrote val -> right -> left in the Python Part
      The Java Part is correct

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому

      @@starbuststream3219 you’re right lol. Thanks for letting me know.

    • @PIRATEKINGDOM
      @PIRATEKINGDOM  2 роки тому

      fixed!

    • @starbuststream3219
      @starbuststream3219 2 роки тому +1

      @@PIRATEKINGDOM Really loved your video! Great content to review before interviews.

  • @arno.claude
    @arno.claude 2 роки тому +1

    Wow, thank you!

  • @gerardom894
    @gerardom894 Рік тому +1

    Is there a follow up for this list?

  • @dr4ks
    @dr4ks 2 роки тому +1

    Just Excellent