Count all Valid Pickup and Delivery Options - Leetcode 1359 - Python

Sdílet
Vložit
  • čas přidán 24. 07. 2024
  • Solving leetcode 1359 - count all valid pickup and delivery options, today's daily leetcode problem on september 9th.
    🚀 neetcode.io/ - A better way to prepare for Coding Interviews
    🥷 Discord: / discord
    🐦 Twitter: / neetcode1
    🐮 Support the channel: / neetcode
    ⭐ BLIND-75 PLAYLIST: • Two Sum - Leetcode 1 -...
    💡 DYNAMIC PROGRAMMING PLAYLIST: • House Robber - Leetco...
    Problem Link: leetcode.com/problems/count-a...
    0:00 - Read the problem
    0:30 - Drawing Explanation
    6:58 - Coding Explanation
    leetcode 1359
    #neetcode #leetcode #python

Komentáře • 42

  • @coldsky_
    @coldsky_ Před 10 měsíci +41

    Really good solution! Definitely want to see a discrete math course :D

  • @akhilchauhan9417
    @akhilchauhan9417 Před 10 měsíci +11

    Yes for Discreet Maths. Especially struggle with recurrence relation.

  • @VidyaBhandary
    @VidyaBhandary Před 10 měsíci +6

    Yes would definitely appreciate a discrete math playlist. Your teaching style is simply awesome 💯

  • @LOVE-kf9xi
    @LOVE-kf9xi Před 10 měsíci +11

    It is a must , I'd love to see the discrete math playlist!

  • @pushpamudalkar6756
    @pushpamudalkar6756 Před 10 měsíci +1

    Really good explanation! You made the hardest problem seem like a piece of cake

  • @user-yj2ju9up8o
    @user-yj2ju9up8o Před 10 měsíci

    Thanks for the explanation. I was struggling with this daily problem and your video was really helpful.

  • @light_70
    @light_70 Před 10 měsíci

    That intuition when you cancel out the possibility of invalid arrangement(divide by 2) was great.

  • @becomingbesthackerprogramm4644
    @becomingbesthackerprogramm4644 Před 10 měsíci +4

    Please get a maths course , it's a must

  • @shreyaspathak1267
    @shreyaspathak1267 Před 10 měsíci +2

    I'd love to see the discrete math videos

  • @StellasAdi18
    @StellasAdi18 Před 10 měsíci

    That was amazing solution. Thanks for the intuition.

  • @MP-ny3ep
    @MP-ny3ep Před 10 měsíci

    Great explanation as always!! Thank you!

  • @becomingbesthackerprogramm4644
    @becomingbesthackerprogramm4644 Před 10 měsíci +2

    Really need it , I suffer sm with maths problem 🤧

  • @amen652
    @amen652 Před 10 měsíci

    A discrete math refresh course would def be nice!

  • @aadil4236
    @aadil4236 Před 10 měsíci +1

    Yes, defenetly want Discrete Math course!!

  • @FullMetalAlgorithmist
    @FullMetalAlgorithmist Před 10 měsíci

    Woah!!!! Amazing explaination.

  • @menasafwat7897
    @menasafwat7897 Před 10 měsíci

    you are genius man , continue you are the best 😎😎

  • @patelmanan96
    @patelmanan96 Před 7 měsíci

    Yes, please make the discrete math video

  • @omkarjadhav6183
    @omkarjadhav6183 Před 10 měsíci +1

    Would love playlist on descrete maths

  • @CS_n00b
    @CS_n00b Před 8 měsíci

    non trivial combinatorics problems playlist would be very useful

  • @Platcode797
    @Platcode797 Před 10 měsíci +1

    Please make discrete maths series, Thanks for the solution

  • @palashsharma26
    @palashsharma26 Před 10 měsíci +1

    Yes please video on discrete math

  • @AdiPrimandaGinting
    @AdiPrimandaGinting Před 10 měsíci

    What is the intuition to reduce slots by 2 at the last line of the while loop. Is it because in each loop we already calculate the pickup and the other delivery is invalid because it can not precede its pickup?

  • @uptwist2260
    @uptwist2260 Před 10 měsíci

    Thanks for the daily

  • @kshitijgarg2609
    @kshitijgarg2609 Před 10 měsíci

    solid explanation

  • @ChadBryant_G3
    @ChadBryant_G3 Před 8 měsíci

    Yes to discrete math course!

  • @arunvijay2279
    @arunvijay2279 Před 8 měsíci

    please do separate series for discrete mathematics

  • @young7529
    @young7529 Před 10 měsíci +3

    definitely want to see the discrete math course

  • @GuruPrasadShukla
    @GuruPrasadShukla Před 10 měsíci

    nice explaination bro
    support from india

  • @ruibinzhang
    @ruibinzhang Před 10 měsíci

    The solution is so easy to understand, but it is difficult for to to solve using Java as I don't know when to do modulo operations.

  • @IK-xk7ex
    @IK-xk7ex Před 10 měsíci

    I got this problem in my today's Days Challenge

  • @AdityaGarud-sm7lw
    @AdityaGarud-sm7lw Před 10 měsíci +1

    yes we want discrete math crash course

  • @jamesabasifreke
    @jamesabasifreke Před 10 měsíci +3

    Discrete math please thanks!

  • @TheMadTech
    @TheMadTech Před 10 měsíci +1

    much needed discrete mathematics

  • @abhis1560
    @abhis1560 Před 10 měsíci

    Please do make maths necessary for algorithms videos please. Not just discrete mathematics

  • @vijayj1997
    @vijayj1997 Před 10 měsíci +1

    Need discrete math course

  • @krateskim4169
    @krateskim4169 Před 10 měsíci

    Awesome

  • @devkumar9889
    @devkumar9889 Před 10 měsíci

    It was simple 10th grade mathematics

  • @SANDEEPKUMAR-in6li
    @SANDEEPKUMAR-in6li Před 10 měsíci +1

    Can you please provide the code in JAVA

    • @dilipsinghdangwal7035
      @dilipsinghdangwal7035 Před 10 měsíci

      class Solution {
      long mod = 1000000007;
      public int countOrders(int n) {
      int slots = 2*n;
      long ans=1;
      while(slots > 0){
      long ops = (slots*(slots-1))/2;
      ops %= mod;
      ans = ans * ops;
      slots = slots-2;
      ans%=mod;
      }
      return (int)ans;
      }
      }

    • @SANDEEPKUMAR-in6li
      @SANDEEPKUMAR-in6li Před 10 měsíci

      @@dilipsinghdangwal7035 Thank You

  • @jasonahn8658
    @jasonahn8658 Před 10 měsíci +1

    FIRST