Three Sum Closest (LeetCode 16) | Full Solution with visual explanation | Interview Essential

Поделиться
HTML-код
  • Опубликовано: 31 июл 2024
  • Actual Problem: leetcode.com/problems/3sum-cl...
    Chapters:
    00:00 - Intro
    00:50 - Problem Statement and Description
    03:20 - Brute Force Solution
    03:59 - Translation to Three Sum
    05:16 - Efficient Solution
    08:23 - Dry-run of Code
    11:12 - Final Thoughts
    📚 Links to topics I talk about in the video:
    Three Sum: • 3 Sum (LeetCode 15) | ...
    Two Sum: • Two Sum (LeetCode #1) ...
    Brute Force Solution: • Brute Force algorithms...
    What is Big O?: • Big O Notation Simplif...
    📘 A text based explanation is available at: studyalgorithms.com
    Code on Github: github.com/nikoo28/java-solut...
    Test-cases on Github: github.com/nikoo28/java-solut...
    📖 Reference Books:
    Starting Learn to Code: amzn.to/36pU0JO
    Favorite book to understand algorithms: amzn.to/39w3YLS
    Favorite book for data structures: amzn.to/3oAVBTk
    Get started for interview preparation: amzn.to/39ysbkJ
    🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
    🎥 My Recording Gear:
    Recording Light: amzn.to/3pAqh8O
    Microphone: amzn.to/2MCX7qU
    Recording Camera: amzn.to/3alg9Ky
    Tablet to sketch and draw: amzn.to/3pM6Bi4
    Surface Pen: amzn.to/3pv6tTs
    Laptop to edit videos: amzn.to/2LYpMqn
    💻 Get Social 💻
    Follow on Facebook at: / studyalgos
    Follow on Twitter at: / studyalgorithms
    Follow on Tumblr at: / studyalgos
    Subscribe to RSS feeds: studyalgorithms.com/feed/
    Join fan mail: eepurl.com/g9Dadv
    #leetcode #programming #interview

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

  • @hoddybhaba6704
    @hoddybhaba6704 Год назад +6

    Great explaination bro however you have a typo in space complexity i guess as it will be O(1)

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

      You are absolutely correct. The space complexity will be O(1). Thanks for pointing that out. :)

  • @sureshkannan6313
    @sureshkannan6313 8 месяцев назад +2

    You're Such an understandable and clear explanation delivering instructor...Thank you.!!!

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

    Your way to explain the approach and code is phenomenal. Thanks you Sir for providing great content 😊❤❤

  • @pavanreddy3460
    @pavanreddy3460 6 месяцев назад +2

    You are explaining the problem clear and crisp.. keep doing the same... Thanks for sharing these videos

    • @nikoo28
      @nikoo28  5 месяцев назад

      So nice of you

  • @NiteshMaurya1111
    @NiteshMaurya1111 День назад

    your explaination is too good

  • @ujjwalsingh6889
    @ujjwalsingh6889 5 месяцев назад +1

    Great Explanation bro👌👌
    I like your teaching method..........👍

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

    very good explaination sir. thanks for your contribution

  • @ghanashrim2839
    @ghanashrim2839 Год назад +1

    I watched your house robber I problem explanation video first, and immediately fell in love with the way you explain the solutions. Your voice is soothing to hear as well and every word is clearly pronounced. I've had issues following other videos due to terrible audio quality and a monotonous tone of explanation.
    Thank you for making my life a bit easier with your solutions.
    Please solve all the problems from Sean Prashad's list 🙏

    • @nikoo28
      @nikoo28  Год назад +1

      Do you feel the audio problem in the recent videos too? All the ones I created House Robber 1?
      I know some of the earlier videos had a problem.
      Thanks for your kind words though :)

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

      @@nikoo28 Oh no, I meant, I had problems following other RUclipsr's videos. I haven't faced issues with your videos so far :)

  • @saurabhc4278
    @saurabhc4278 10 месяцев назад +2

    Awesome number line intuition !!

    • @nikoo28
      @nikoo28  9 месяцев назад

      Thank you!

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

    I was thinking of the same approach but couldn't find that last piece but after watching this video i got it, Thankyou this video was very helpful !

    • @nikoo28
      @nikoo28  9 месяцев назад

      glad it helped you

  • @subee128
    @subee128 7 месяцев назад +1

    Thank you

  • @sanand6084
    @sanand6084 Год назад +1

    Awesome as usual ! Can you please make a video which sort of gives a general approach to solve questions involving two pointers ?

    • @nikoo28
      @nikoo28  Год назад +1

      Great suggestion!

  • @AnandL-yb2sg
    @AnandL-yb2sg Месяц назад

    Thanks...

  • @jayeshpatil5757
    @jayeshpatil5757 Месяц назад

    Thanks 20 June 19:02

  • @subhendumahanta3717
    @subhendumahanta3717 8 месяцев назад

    if sum is less than the target, we have 2 options: increment left or decrement right. You have chosen to increment left. I can choose decrement right. Are the equivalent ?

    • @nikoo28
      @nikoo28  7 месяцев назад +1

      Is sum is less than target, and you decrement right…the sum will become even smaller..because the array is sorted. So you will get a smaller sum

  • @Keraman9
    @Keraman9 4 месяца назад

    friend, remove the apple logo in your video, put the known one not this shit
    Thanks for the explanation beside that