sir my program is correct but its showing me test case fail
Regarding this testcase
hello @sraj39273
yeah u cant store such big numbers in long long or any other primitive datatype.
the idea is to use array.
intially the array will hold 1. (indicating 1 factorial)
and then iterate from 2 to n(to compute n!) , multiply this number with the number available in array and update the array.
for example if u have to store 23 in array then store it as
3 | 2
now let say u have to multily this number 23 with 2 .
so simply iterate this array and multiply by 2 but do take care of carry
6 | 4
for printing simply iterate from right to left.
refer this code for clarity->
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.