Skip to main content
2 of 3
added 56 characters in body
Variax
  • 151
  • 2

[MATLAB/Octave], 35 34 bytes

A=factorial(1:n) A(A<=n)(end) 

The second echo will return the result. Might crash your system for large values of n.

Variax
  • 151
  • 2