Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Saved bytes, added explanation; deleted 1 character in body; edited body
Source Link
Luke
  • 4.9k
  • 17
  • 23

Japt, 8(削除) 8 (削除ここまで) 6 bytes

ol aU ¦Jx\U

Try it online! Try it online!

This outputs 0 for false and 1 for true.

Explanation

 ol x\ U
Uol x==U
Uo # Create the range [0 ... input]
 l # Replace each element by its factorial
 ==U # Compare each element to the input (yielding 1 if equal and 0 otherwise)
 x # And sum the result

Japt, 8 bytes

ol aU ¦J

Try it online!

Japt, (削除) 8 (削除ここまで) 6 bytes

ol x\U

Try it online!

This outputs 0 for false and 1 for true.

Explanation

 ol x\ U
Uol x==U
Uo # Create the range [0 ... input]
 l # Replace each element by its factorial
 ==U # Compare each element to the input (yielding 1 if equal and 0 otherwise)
 x # And sum the result
Source Link
Luke
  • 4.9k
  • 17
  • 23

Japt, 8 bytes

ol aU ¦J

Try it online!

AltStyle によって変換されたページ (->オリジナル) /