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 Revisions

2 of 6
added 537 characters in body
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

Husk, 18 bytes

1ドルmΠfF¤|%10momd1⁄2Pd

Try it online!

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

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