[Community Puzzle] Heart of the City

Hi

I recently discovered this old puzzle and like everyone, I went through “it can’t be that hard” to “not so easy actually”, and finally “pretty hard indeed!”.
I found the underlying math involved and did the necessary research. I now have two solutions that consistently pass all tests and all validators, except the last one (validator 7).
I’m rather confident it’s not due to speed, because both solutions easily pass the ultimate test. I would also be surprised if the final validator was some kind of “trick number” requiring some special computation, due to the maths involved behind this puzzle.

Is it possible to know what the final validator is?

The input to Validator 7 is a very close number to Test 7. Somehow it’s the only case, among all the tests and validators, where the input is an even number :thinking:

And the constraint has been violated by that validator in terms of both the magnitude and the fact that the input is even…

I’ll modify the validator later today.

1 Like

I’ve edited the validator, and added/changed a couple of other cases as well because I’ve found some other issues with them.

Thank you, it works perfectly now!

1 Like