25th Sep 2017, 4:18 PM
Calviղ
Calviղ - avatar
+ 11
https://code.sololearn.com/cgfc7U5PEK62/#java my try
26th Sep 2017, 12:46 AM
Vukan
Vukan - avatar
26th Sep 2017, 7:06 AM
David Akhihiero
David Akhihiero - avatar
+ 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.
25th Sep 2017, 4:45 PM
David Carroll
David Carroll - avatar
26th Sep 2017, 8:09 AM
Nick
Nick - avatar
26th Sep 2017, 9:09 AM
m abrate
m abrate - avatar
26th Sep 2017, 2:44 PM
Swapnil Srivastava
Swapnil Srivastava - avatar
25th Sep 2017, 4:21 PM
Lakshay
Lakshay - avatar
25th Sep 2017, 7:30 PM
VcC
VcC - avatar
26th Sep 2017, 3:10 AM
Aaron Icenhour
Aaron Icenhour - avatar
+ 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; }
26th Sep 2017, 3:25 PM
🇳🇵Bed Narayan Rai
🇳🇵Bed Narayan Rai - avatar
+ 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
26th Sep 2017, 8:17 PM
Saurabh Tiwari
Saurabh Tiwari - avatar
27th Sep 2017, 7:07 AM
Sanjeev Kumar
Sanjeev Kumar - avatar
25th Sep 2017, 4:22 PM
Lakshay
Lakshay - avatar
+ 3
@ace nope. read again.0 if not a factorial n if n!
25th Sep 2017, 10:16 PM
VcC
VcC - avatar
26th Sep 2017, 3:32 AM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
+ 3
https://code.sololearn.com/cPPwmEB4B4R9/?ref=app
27th Sep 2017, 7:28 AM
Shashank Shekhar
Shashank Shekhar - avatar
26th Sep 2017, 2:50 PM
Ferhat Sevim
Ferhat Sevim - avatar
26th Sep 2017, 4:09 PM
ysraelcon
ysraelcon - avatar
+ 2
I tried but couldn't do better than this... kindly help me in solving it... https://code.sololearn.com/cQE7cWDIpIPf/?ref=app
26th Sep 2017, 6:11 PM
Saurabh Tiwari
Saurabh Tiwari - avatar