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?
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; } }
Really good solution! Definitely want to see a discrete math course :D
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!
Yes for Discreet Maths. Especially struggle with recurrence relation.
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
Really good explanation! You made the hardest problem seem like a piece of cake
Really need it , I suffer sm with maths problem 🤧
Thanks for the explanation. I was struggling with this daily problem and your video was really helpful.
Yes, defenetly want Discrete Math course!!
non trivial combinatorics problems playlist would be very useful
A discrete math refresh course would def be nice!
Yes, please make the discrete math video
Would love playlist on descrete maths
Yes to discrete math course!
Yes please video on discrete math
Please make discrete maths series, Thanks for the solution
That was amazing solution. Thanks for the intuition.
Great explanation as always!! Thank you!
Woah!!!! Amazing explaination.
please do separate series for discrete mathematics
you are genius man , continue you are the best 😎😎
Discrete math please thanks!
yes we want discrete math crash course
definitely want to see the discrete math course
solid explanation
Thanks for the daily
much needed discrete mathematics
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?
nice explaination bro
support from india
I got this problem in my today's Days Challenge
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.
whats up future doordashers
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