Skip to main content
1 of 3
Gabriel Benamy
  • 2.9k
  • 12
  • 16

#Perl, 29 +2 = 31 bytes

Run with -F. Older version of Perl might require you to run with -nF instead, if -F does not imply -n.

grep{$a+=$_**$#F}@F;say$a==$_

Prints 1 if narcissistic, prints nothing otherwise.

Gabriel Benamy
  • 2.9k
  • 12
  • 16