Count all Valid Pickup and Delivery Options - Leetcode 1359 - Python
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
Really good solution! Definitely want to see a discrete math course :D
Yes for Discreet Maths. Especially struggle with recurrence relation.
Yes would definitely appreciate a discrete math playlist. Your teaching style is simply awesome 💯
It is a must , I'd love to see the discrete math playlist!
Really good explanation! You made the hardest problem seem like a piece of cake
Thanks for the explanation. I was struggling with this daily problem and your video was really helpful.
That intuition when you cancel out the possibility of invalid arrangement(divide by 2) was great.
Please get a maths course , it's a must
I'd love to see the discrete math videos
That was amazing solution. Thanks for the intuition.
Great explanation as always!! Thank you!
Really need it , I suffer sm with maths problem 🤧
A discrete math refresh course would def be nice!
Yes, defenetly want Discrete Math course!!
Woah!!!! Amazing explaination.
you are genius man , continue you are the best 😎😎
Yes, please make the discrete math video
Would love playlist on descrete maths
non trivial combinatorics problems playlist would be very useful
Please make discrete maths series, Thanks for the solution
Yes please video on discrete math
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?
Thanks for the daily
solid explanation
Yes to discrete math course!
please do separate series for discrete mathematics
definitely want to see the discrete math course
nice explaination bro
support from india
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.
I got this problem in my today's Days Challenge
yes we want discrete math crash course
Discrete math please thanks!
much needed discrete mathematics
Please do make maths necessary for algorithms videos please. Not just discrete mathematics
Need discrete math course
Awesome
It was simple 10th grade mathematics
Can you please provide the code in JAVA
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;
}
}
@@dilipsinghdangwal7035 Thank You
FIRST