#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.
#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.