public class Main
{
public static int fact(int n) { // void -> int (My Mistake)-01
if(n == 0 || n == 1) {
return 1;
}
// recursion
return n * fact(n-1);
}
public static void main(String[] args) {
System.out.println(fact(5));
}
}
Yes. I found an available transcript of the video and summarized it simply. The video is “How To Become Red Coder? (codeforces.com)” by Err...
No comments:
Post a Comment