Clarification needed for Problem-103 (Easter Eggs)

Back to General discussions forum

Amit Saha     2020-08-25 09:39:31
User avatar

The problem asks for the index of eggs which need to be touched to turn all eggs into white. But what if there are multiple solutions?

For the example shown, it is said that touching 1-st, 2-nd and 4-th eggs will turn them all to white But I found that If I touch last 2 eggs (4-th & 5-th), it also works.

So, will any answer work OR there needs to be minimum number of touches?

Rodion (admin)     2020-08-25 15:41:44
User avatar

Hi Friend!

I honestly don't remember for sure, but you can try and see :)

I believe checker tries the answer you give and sees if all eggs are turned white. So any suitable answer should work.

Amit Saha     2020-08-25 16:21:10
User avatar

That's Ok.

I tried. And fortunately, for my test input, there was only one solution.

Midwinter     2021-05-28 12:18:18

Hi Amit and Rodion,

Hope you don't mind me replying to an older discussion. I just solved Easter Eggs and, like Amit, found the answer "4 5" for the example, not "1 2 4".

Both answers are correct, but since my solution finds only shortest paths, it doesn't come across "1 2 4".

Rodion, would it be a good idea to add a hint to the example, that says there may be shorter answers than "1 2 4"?

Rodion (admin)     2021-06-08 20:48:55
User avatar

Midwinter, Hi!

Sorry for delay, I think I should review the checker for this problem and perhaps make it accept any solution. I just poorly remember this problem (perhaps it was created while the site couldn't use more clever checkers)... Hopefully I'll be back soon!

Midwinter     2021-06-11 10:07:53

Hi Rodion,

Thanks for your answer, and don't worry about the delay. I was able to solve #103, so it didn't hold me back. ;)

Please understand, I think the checker is fine, and it accepts all possible solutions correctly.

My comment was about the example, which gives a sub-optimal solution "1 2 4". So if readers find the optimal solution "4 5" they may think they're doing it wrong. I was just saying, maybe it's a good idea to add a hint to the example text, that says there may be multiple solutions.

On the other hand, in the meantime I've tried to solve the advanced version (#222), and failed horribly so far - which made me realise how unimportant my suggestion is. ;)

Please login and solve 5 problems to be able to post at forum