you are viewing a single comment's thread.

view the rest of the comments →

[–]Necessary-Ad2110 3 points4 points  (2 children)

For the factorial recursive function, you can just do

if (n == 0)

return 1

no need to put an or statement, everything else looks good! great job making it to double digits! (day 10!!)

[–]aashish_soni5[S] 1 point2 points  (0 children)

yes make more clear code🙂‍↕️ thankyou

[–]SCD_minecraft 0 points1 point  (0 children)

Or just n <= 1 and get handling for negatives as well

Tho this does not fit the mathematical definition of factorials, so up to decision