This Challenge is derived from GJam 2013 China Bad Horse partial of data set #2. Cody appears to have a testsuite size limit so only 32 of 100 cases are loaded. Brute force of 2^100 permutations may time out. The problem is codified using a cell array of names.
The Challenge involves creating two teams with no pair of individuals on either team having a conflict. The input is a list of pairs of individuals who can not be placed on the same team. The Challenge is to determine if two teams can be created that do not have any players with conflicts.
Input: conflicted name pairs (cell array of pairs of names)
Output: TF (TF=1 if two Good teams are possible, 0 if Happy teams are non-producible)
Competition Summary: Best Time of 11 minutes, 707 out of 776 correct
I tried to put in all 100 cases but the testsutie clipped. Had similar problem on my 3900 test cases of Cannon Ball.
If I am not mistaken several of the current solutions would fail the following test: names={{'a','b'}, {'c','d'}, {'d','e'}, {'e','c'}}; (they should return 0)
I will run the solutions against the full Google Set to find a more robust subset of test cases. I may also add your suggested case. Thank for the feedback.
note: this solution is not correct (e.g. {{'a','b'},{'b','c'},{'c','a'},{'d','e'}} should return 0)
Elapsed time is 0.047208 seconds.
:-D
0.087544s
going for speed here (6 problems in 0.168566s)
417 Solvers
583 Solvers
How long do each of the stages of the rocket take to burn?
63 Solvers
Method of Common Differences part-2
14 Solvers
369 Solvers