• Some weird things are going on with this exercise

Question related to mission Family Gifts

 

I have 3 issues:

  1. The checker is very random. Sometimes my code fails on basic test 3, sometimes on basic test 5, sometimes on extra test 1, sometimes on extra test 2. Who knows, if I keep repeatedly checking I may even pass it at some point.

  2. The asserts always give me an assertion error in CheckiO, but when I copy my code and run it on my own PC, the asserts all check out. I don't understand why there's a difference.

  3. My code (see attachment) is a "brute force" code that grabs all permutations and then eliminates those that violate a rule. Yet, for some reason, I'm never finding enough chains. I'm always 1 or 2 chains short, according to the checks. How is this possible?