+ 11
https://code.sololearn.com/cgfc7U5PEK62/#java
my try
+ 8
My humble attempt in java
https://code.sololearn.com/cw8EUZejbyu4/?ref=app
+ 7
Thanks for showing a really good example of a challenge that is clear and concise.
I actually enjoyed thinking about this challenge. It shows that a factorial result can be validated by dividing each successive term, starting with dividing the input by 2, then dividing that quotient by 3, then 4, and so on, until yielding 1 as the final quotient. As long as each successive quotient yields a whole number where the final whole number quotient is 1, the factorial is valid and the factorial base will be the divisor used to yield 1 as the final quotient.
I'll try to submit a code sample using lambda expressions in one of the languages later.
+ 6
my try in Python..🐍
https://code.sololearn.com/cb463CFzBDx5/?ref=app
+ 6
See my code -
https://code.sololearn.com/cI1uIwQr7un0/?ref=app
+ 5
Here's the code:
https://code.sololearn.com/chK39KCTDQ0K/?ref=app
+ 4
Here's mine.
https://code.sololearn.com/cjalTTzNjc60/?ref=app
+ 4
https://code.sololearn.com/ccbE3mcoq4N1
Challenge: Reverse Factorial
Sol:
C++
#include <iostream>
using namespace std;
int main() {
int num,cur,res;
cin>>num;
if(num == 1)
cout<<"Output: 0! or 1!";
else if(num > 1)
{
res=2;
cur=1;
while(num>cur)
{
int fac=1,temp=res;
while(temp)
fac*=temp--;
cur=fac;
if(num == cur) break;
res++;
}
if(num == cur)
cout<<"Output:"<<res<<"!";
else
cout<<num<<" is not a reverse factorial. ";
}
else cout<<"Please enter positive integer number.";
return 0;
}
+ 4
I did it!!!
tried whole day and now at midnight I got success,
so happy to share it...
https://code.sololearn.com/c440IK1e94Cx/?ref=app
+ 4
Here is my try....
https://code.sololearn.com/c5WBuEQAbevI/?ref=app
+ 3
You can also refer to:
https://www.sololearn.com/discuss/548095/?ref=app
+ 3
@ace nope. read again.0 if not a factorial n if n!
+ 3
https://code.sololearn.com/cPPwmEB4B4R9/?ref=app
+ 2
Here is my version.
https://code.sololearn.com/cPfffpGHj4nY/?ref=app
+ 2
my practice on python https://code.sololearn.com/csv2TWmr2BKn/#py
+ 2
I tried but couldn't do better than this...
kindly help me in solving it...
https://code.sololearn.com/cQE7cWDIpIPf/?ref=app