Grid based dp path finding

how the time complexity of mathematical approach is O(n) it should be O(1) i think please explain it??

No its O(n) only, this is because you have to calculate factorial, which takes O(n) time complexity!

Oh yess… And how to find permutation if n and m is so large??

for large cases, mod is mentioned then its no problem as you may take mod on every step after multiplication(but remember for division you must take modular inverse!)

Ohk bhaiya thanks… …

Mark doubt as resolved if satisfied

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

@rishabhmahajan546 sir please clear brackets all over problem??

@shampblocks You can reopen that doubt or post it again!

@shampblocks bro ap brackets wale qstn me doubt raise kro and mention me ,i will take it.