Hello,
I have a question about the last testcase for “Prime Transformations” https://www.codingame.com/training/expert/prime-transformations:
The numbers are: 2860866142560 = 2^5 * 3^3 * 5 * 17 * 19^2 * 29 * 61^2 and
78604642094119757 = 7 * 11^2 * 19^2 * 29 * 31^2 * 37 * 61^2 * 67.
While the first number has 15 factors, the second one only has 12.
So, how can this be a valid mapping?
My code already passed the validators, but this input still confuses me.
To be honest, there is a way to solve the problem. If you forget about the fact that the last clue is invalid, then you can gain just enough information to deduce that 29 can only map to 7.
Nevertheless:
the statement does not mention malformed clues,
solutions based on finding the “most general transformation” will fail miserably because of the inconsistency of this last clue.
Looks like mentioning problem bugs in contributions is not enough to have their approval delayed, when taking action-any-action is incentivized. I’m afraid this comes as no surprise.
Oh, does this mean I can still submit my correct code? That’d be good news
I haven’t attempted to solve this puzzle yet. I’ll put it high on my list because if I can validate what you are saying, I can probably do something about it.
One thing I was able to do very quickly is to check the original author’s (@TheNinja) code. It passes all tests and validators.
One cannot publish (save a published contribution) if the provided solution doesn’t pass the test. This feature has been added something like two weeks ago and it is retroactive (we’ve unpublished contributions which didn’t validate this)
Okay. So I have solved this puzzle, and I agree. The 5th test case doesn’t follow the problem statement. The last pair of numbers has a 7 -> 8 prime factorization mapping. The statement clearly indicates that each number pair should have an n -> n factorization mapping.
That being said, I will point out that my own solution code is agnostic to this discrepancy, as I assume is the solution of all others who have solved the puzzle already. So I can understand why this error might have been overlooked by many of the reviewers.
I have verified that this does, indeed, rectify the problem (8 -> 8 prime factorization mapping), and is still solvable by both my code and @TheNinja’s code, and so I have changed the test case accordingly. Thanks for the suggestion.
As an aside, I have also changed the stub generator to read [[X]], [[Ai]], and [[Bi]] as long instead of as int.
This puzzle (Prime Transformations) is crazily complicated. It is more about logical deduction than copy&paste a prime function. Thanks the earlier efforts to fix hidden bugs I can pass it without too much frustration.