Easter Eggs

Back to Problem Solutions forum

Vladimir_V     2015-12-08 13:23:49

Hi! I am really stuck with this problem. 1. I know that we do need recursion to solve this problem 2. I know that Brute-Force algorithm does not work here,because with 20 eggs we have a lot variants. 3. I know that it important in which order the eggs are chosen. Guys please tell me what i still do not know to solve this problem:) Thanks !

GlideThestral     2015-12-08 14:17:46

All three statements are wrong:

  • you don't need recursion here, more simple methods will work

  • BF for 20 eggs could be fast enough if you really need it

  • order is not important - and it's a key for solution :)

Vladimir_V     2015-12-08 20:58:02

Thanks a lot for suggestions , especially for # 3. Now how to check all possible variants still is a big puzzle for me

Vladimir_V     2015-12-10 11:14:13

If we to use Brute-Force algorithm for this task , we have 1(from 20),2(from 20),3(from 20),4(from 20),4(from 20),...... 20(from 20), permutations. It is imposible to check this becoause of cosmic large number of possible combinations.

GlideThestral     2015-12-11 14:41:02

You don't need permutations. Use subsets. There are only 2^20 of them.

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