A vampire number is a number v that is the product of two numbers x and y such that the following conditions are satisfied:
If these conditions are met, x and y are known as "fangs" of v. For example, 1260 is a vampire number because 1260 = 21*60, so 21 and 60 are the fangs.
Write a function that determines whether two numbers are fangs of a vampire number.
See also: 1825. Find all vampire fangs and 1826. Find vampire numbers.
Sorry for all the false positives. I have added more test cases.
It turns out that the difference in meaning between "not both" and "both not" is critical to this problem. Do'h! Took me a while to figure out where I was going wrong. :P
Exactly what I like in Cody. Interesting and modular problem, with good explanations.
What else ?
Thank you, Jean-Marie! If I have time, I might extend the problem even further.
Oops--does not check all conditions--should not have passed.
I now see that this is not a valid solution..it has false positives but still passes the test suite :-(
5579 Solvers
Find the sum of the elements in the "second" diagonal
872 Solvers
335 Solvers
Convert a vector into a number
441 Solvers
114 Solvers