Sleepy Cracker
Sleepy Cracker
  • 1 164
  • 156 818
#LeetCode 1356 | Sort Integers by The Number of 1 Bits #Java
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing
Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
Переглядів: 5

Відео

#LeetCode 2859 | Sum of Values at Indices With K Set Bits #Java
Переглядів 17 годин тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 597 | Friend Requests I: Overall Acceptance Rate #SQL
Переглядів 9День тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2485 | Find the Pivot Integer #Java
Переглядів 9День тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2595 | Number of Even and Odd Bits #Java
Переглядів 10День тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 1135 | Connecting Cities With Minimum Cost #Java
Переглядів 1914 днів тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2496 | Maximum Value of a String in an Array #Java
Переглядів 814 днів тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2643 | Row With Maximum Ones #Java
Переглядів 1014 днів тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2119 | A Number After a Double Reversal #Java
Переглядів 214 днів тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 1150 | Check If a Number Is Majority Element in a Sorted Array #Java
Переглядів 821 день тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2728 | Count Houses in a Circular Street #Java
Переглядів 1221 день тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2913 | Subarrays Distinct Element Sum of Squares I #Java
Переглядів 1421 день тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2894 | Divisible and Non-divisible Sums Difference #Java
Переглядів 621 день тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 89 | Gray Code #Java
Переглядів 15Місяць тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2269 | Find the K-Beauty of a Number #Java
Переглядів 12Місяць тому
Questions in English: docs.google.com/spreadsheets/d/1QNSEok-WD4LCPTrZlqq5VVTX0NbXQf27WUjkGi3aBu0/edit?usp=sharing Questions in Mandarin: docs.google.com/spreadsheets/d/1aMCmSLucm7I_7BIRz1SqHy8c1D9h_6M8XAkrqWXSy8Y/edit?usp=sharing
#LeetCode 2164 | Sort Even and Odd Indices Independently #Java
Переглядів 31Місяць тому
#LeetCode 2164 | Sort Even and Odd Indices Independently #Java
#LeetCode 2490 | Circular Sentence #Java
Переглядів 7Місяць тому
#LeetCode 2490 | Circular Sentence #Java
#LeetCode 157 | Read N Characters Given Read4 #Java
Переглядів 17Місяць тому
#LeetCode 157 | Read N Characters Given Read4 #Java
#LeetCode 773 | Sliding Puzzle #Java
Переглядів 83Місяць тому
#LeetCode 773 | Sliding Puzzle #Java
#LeetCode 2706 | Buy Two Chocolates #Java
Переглядів 11Місяць тому
#LeetCode 2706 | Buy Two Chocolates #Java
#LeetCode 2869 | Minimum Operations to Collect Elements #Java
Переглядів 82 місяці тому
#LeetCode 2869 | Minimum Operations to Collect Elements #Java
#LeetCode 1640 | Check Array Formation Through Concatenation #Java
Переглядів 62 місяці тому
#LeetCode 1640 | Check Array Formation Through Concatenation #Java
#LeetCode 1893 | Check if All the Integers in a Range Are Covered #Java
Переглядів 92 місяці тому
#LeetCode 1893 | Check if All the Integers in a Range Are Covered #Java
#LeetCode 815 | Bus Routes #Java
Переглядів 182 місяці тому
#LeetCode 815 | Bus Routes #Java
#LeetCode 1481 | Least Number of Unique Integers after K Removals #Java
Переглядів 62 місяці тому
#LeetCode 1481 | Least Number of Unique Integers after K Removals #Java
#LeetCode 625 | Minimum Factorization #Java
Переглядів 82 місяці тому
#LeetCode 625 | Minimum Factorization #Java
#LeetCode 670 | Maximum Swap #Java
Переглядів 692 місяці тому
#LeetCode 670 | Maximum Swap #Java
#LeetCode 696 | Count Binary Substrings #Java
Переглядів 42 місяці тому
#LeetCode 696 | Count Binary Substrings #Java
#LeetCode 603 | Consecutive Available Seats #SQL
Переглядів 92 місяці тому
#LeetCode 603 | Consecutive Available Seats #SQL
#LeetCode 1566 | Detect Pattern of Length M Repeated K or More Times #Java
Переглядів 52 місяці тому
#LeetCode 1566 | Detect Pattern of Length M Repeated K or More Times #Java

КОМЕНТАРІ

  • @rsKayiira
    @rsKayiira 13 днів тому

    great solution but wish you explained it more

    • @sleepycracker4732
      @sleepycracker4732 7 днів тому

      I'm glad you enjoyed the solution. Is there a specific part you would like me to expand upon?

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

    Hey, What do you do now? I am looking for a new job opportunity, gotta grind on leetcode. How would you do it if you were me?

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

      Keep practicing LeetCode consistently, whether it’s easy, medium, or hard problems. Focus on truly understanding the problem and improving your problem-solving skills. This not only prepares you for coding rounds but also helps you showcase your ability to handle real-world projects effectively within a firm.

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

    Thank you for simple Explanation.

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

    Great video solution thank you

  • @21flame72
    @21flame72 2 місяці тому

    super

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

    worst problem in leetcode

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

    Do you have a list of topics for competitive programming where minimum prerequisites are required?

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

    No.238 link in the Google sheet turn out to be this vedio....

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

    amazing breakdown

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

    If we’re putting all the transactions in hashmap in the first for loop, then in the 2nd for loop when we’re going through all the transactions, wouldn’t we see the same transaction at both places and time will be the same too and so it will be within the 60 minute window since you put <= sign and not <. And all the transactions would be invalid by default due to that?

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

      Oh nvm, there’s another condition that the city should be different, if it could be the same then there would be some problems. Thank you, very helpful video, learnt alot!

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

      good comment. glad you get it

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

    your approach is pretty good but it's effectively the same as sorting all intervals initially which would have a time complexity (TC) of O((n×m)log(n×m)) during heap initialization, you are pushing all intervals into the heap. this costs n×m intervals in total where n is # of employees & m is the # of intervals inserting each one into the heap takes O(log(n×m)) time. The total time to insert all intervals would be O(n×mlog(n×m)). heap Ops: after heap is initialized with all intervals, you still need to pop each interval one by one and merge them. each pop op takes O(log(n×m)), and you need to do this for all n×m intervals, so the total time for this step is also O(n×mlog(n×m)) an optimized approach would be to push the first interval of each employee and then push the next interval dynamically as we process. this minimizes heap size to n (the # of employees). this approach effectively reduces to Merging K Sorted Lists that has a TC of O(n×mlogn) which is better than O(n×mlog(n×m))

  • @RohitKumar-nx8pd
    @RohitKumar-nx8pd 3 місяці тому

    time complexity will be O(n^2)

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

      for the worst-case scenario, that's correct. The average case, it is going to be O(N)

    • @RohitKumar-nx8pd
      @RohitKumar-nx8pd 3 місяці тому

      @@sleepycracker4732 yes 👍 but we can use sweep algo + prefix sum for optimal solution

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

      that's correct.

  • @Emanuel-yb3qk
    @Emanuel-yb3qk 3 місяці тому

    Thanks bro. Really worked.

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

    I really appreciate your work , I guess you didn't insert this video link(386.Lexicographical Numbers) in English Google Spread Sheet. Make sure you update and advance in thanks :)

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

    Bro you explain too fast . But good explanation. Can you upload video of every Daily Leetcode question?

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

      If I went too fast, feel free to slow down the video or pause it to better absorb the information. As for the daily LeetCode question, I don’t think I have enough time for it right now, but I’ll consider it as a suggestion.

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

    Are you XT who works in Google?

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

    Are you chinese?

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

    You Hardwork will Never get wasted , Your Well Deserving

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

    Not able to understand time and space comllexity

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

      to be honest, I am not sure the time and space complexity, but if you are using catalan solution. it should have an answer closes to that formula at 8:16

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

    Hey, just wanted to say this video really helped, I hope that you become the top result/answer for this problem.

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

    Can I give you a testcase where this fails?

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

      maybe you can copy my code from video and run it on your Leetcode debugger to analyze the testcase itself

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

    Old solution: ua-cam.com/video/uwMrZ_z4LIg/v-deo.html (audio issue)

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

    Excellent explanation...

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

    thanks for solution... can we have another solution too whose time complexity will be lesser than this ???

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

    Thank you...approach was easy to understand

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

    Awesome explanation!!!

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

    Thank you 😊

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

    Good Effort, please keep it up.

  • @BABATUNDE-h7d
    @BABATUNDE-h7d 5 місяців тому

    i did'nt understand the for each loop here, can you explain

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

    Very cool technique. Thank you :-)

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

    U could provide a link to the codebase or preferably give the code in the comments. :)

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

      good advice, but I don't like to give away code like that.

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

    Bruteforce method and 5 ms runtime :(

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

    thanks a lot!

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

    If you are making video of something , shouldn't you be clear and well heard . additionally you should pronounce words properly .just a feedback after watching your video

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

      thanks for watching. I am making the video for myself. Best,

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

    Good Approach💯

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

    Thank you for the code and the explanation. Keep up the good work.

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

    Best Explaination

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

    thank you man :)

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

    Dude, thanks!

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

    NICE SUPER EXCELLENT MOTIVATED

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

    Bro's cooking very quiet in silence

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

    those keyboard clicks are so irritating

  • @AmitKumar-uu6dl
    @AmitKumar-uu6dl 7 місяців тому

    Thank you bhaiya, it is very helpful 😊

  • @RyanR-r3l
    @RyanR-r3l 8 місяців тому

    ❤me too lol

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

    similar question: ua-cam.com/video/hwgZAy8oRRk/v-deo.html

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

    similar question: ua-cam.com/video/HVBxIP1zcPY/v-deo.html

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

    the old video can be accessed through here: ua-cam.com/video/rtkAsSUjpQ0/v-deo.html However, youtube currently disable people to view it report: ua-cam.com/users/postUgkxRzAU91_3AwBrjd3otZb0lrKsueNfbiac

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

    nice explanation!

  • @ShubhamSharma-sf8wk
    @ShubhamSharma-sf8wk 8 місяців тому

    Bro get a decent mic

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

      Apologies, it was crafted two years back. However, the setup wasn't prepared at that time.

    • @ShubhamSharma-sf8wk
      @ShubhamSharma-sf8wk 8 місяців тому

      @@sleepycracker4732 No worries, great explanation tho