This is to both you and your parent reply -- have I completely misread statement 3?
'3. If the number of letters in the product's name shares any common factors (besides 1) with the number of letters in the customer's name then the SS is multiplied by 1.5.'
To me, this says that if len(pname) is split into prime factors, and at least one of those is found in the list of prime factors for len(cname), then you multiply your SS by 1.5. The "besides 1" remark is obvious, because 1 is technically a factor for every number. I'm not quite sure how the math pedants come down on that, but this is just common sense.
Negative or positive shouldn't really affect this (I guess it could be construed as "-1" instead of "1" in the factor list, but.. you've really got to bend over backward to make that into a problem), and it's completely not ambiguous. The "besides 1" could not reasonably be taken to mean "besides the first statement", as the two statements deal with very different subject matter.
You're fine, I'm the crazy one...err...ignorant one! I was just wrong. In viewing some of the other comments on this thread, it's clear to me that milo would have done a fine job of filtering me out! :-)
FWIW, I looked at the problem differently - I interpreted "factors" completely the wrong way. I'm humble enough to say that my bad interpretation is based on my own lack of education in mathematics. I have none! Zero, outside of what you get in high school. I'm definitely not the low-level algorithm guy. My lack of math skills has not held me back professionally, but I get healthy doses of humility, like this, on occasion. "One day" I want to go back and study math and see what I've been missing all these years.
I wanted to give you the respect of a reply since you took the time to comment.
Uh, I didn't mention the algorithm at all. As someone else mentioned, the hard part of this problem is finding an optimal solution; there's some minor stuff with keeping information together and building a modular program, but what I said is completely unrelated to that.
As we're entirely just discussing the spec, and not the secret hidden hardness of this problem, could you tell me what I missed? If you're concerned for their confidentiality, then email it to me at carss.w@gmail.com
Disclosure: I'm not planning to apply to this job or to complete this challenge, because I have other things to program for fun, and an internship / school to keep me busy. I'm strictly curious about our different interpretations of what seems (to me) like an unambiguous spec, and I'm prepared to be totally wrong on my reading of it.
'3. If the number of letters in the product's name shares any common factors (besides 1) with the number of letters in the customer's name then the SS is multiplied by 1.5.'
To me, this says that if len(pname) is split into prime factors, and at least one of those is found in the list of prime factors for len(cname), then you multiply your SS by 1.5. The "besides 1" remark is obvious, because 1 is technically a factor for every number. I'm not quite sure how the math pedants come down on that, but this is just common sense.
Negative or positive shouldn't really affect this (I guess it could be construed as "-1" instead of "1" in the factor list, but.. you've really got to bend over backward to make that into a problem), and it's completely not ambiguous. The "besides 1" could not reasonably be taken to mean "besides the first statement", as the two statements deal with very different subject matter.
Am I crazy here? Did I miss something?