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 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!
Please get a maths course , it's a must
That intuition when you cancel out the possibility of invalid arrangement(divide by 2) was great.
I'd love to see the discrete math videos
Really need it , I suffer sm with maths problem 🤧
Really good explanation! You made the hardest problem seem like a piece of cake
Yes, defenetly want Discrete Math course!!
non trivial combinatorics problems playlist would be very useful
Yes, please make the discrete math video
Thanks for the explanation. I was struggling with this daily problem and your video was really helpful.
Yes to discrete math course!
A discrete math refresh course would def be nice!
Would love playlist on descrete maths
Please make discrete maths series, Thanks for the solution
please do separate series for discrete mathematics
Yes please video on discrete math
Woah!!!! Amazing explaination.
you are genius man , continue you are the best 😎😎
definitely want to see the discrete math course
That was amazing solution. Thanks for the intuition.
yes we want discrete math crash course
Discrete math please thanks!
Great explanation as always!! Thank you!
much needed discrete mathematics
Need discrete math course
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?
solid explanation
nice explaination bro
support from india
I got this problem in my today's Days Challenge
Thanks for the daily
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.
Please do make maths necessary for algorithms videos please. Not just discrete mathematics
whats up future doordashers
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