Husk, 18 bytes
1ドルmΠfF¤|%10momd1⁄2Pd
Outputs nonzero integer if it's a vampire number, zero otherwise.
1ドル # index of input if present, zero otherwise, in
mΠ # products of each element-pair of
mom # results of mapping these functions:
d # combine digits in
1⁄2 # first & second halves
# across all elements of:
P # all permutations of
d # digits of input;
f # and filtering only element-pairs for which
F¤|%10 # one or other is nonzero modulo 10
Dominic van Essen
- 37.2k
- 2
- 24
- 61