Seven security personnel of a company: zhao, money, sun, lee, zhou, wu, Chen, because the job needs to dwell system, a day off each week, and let each person chooses in advance oneself think right day off, please prepare a program that prints were rested all possible solutions, certainly must make everyone satisfied, such as choice of each day of rest is as follows: zhao: on Tuesday, Thursday money: Monday, Saturday: sun li on Sunday: on Friday week: Monday, Wednesday, Thursday, Saturday, wu: Tuesday, Friday Chen: Wednesday, Saturday, Sunday,
The index=0 Key=' For k, v in d.i tems () : If the index & gt; 0: Cur=it. The product (cur, v) CPU=copy. The copy (cur) If the index & gt; 1: CPU=[the list (I [0]) + [I [1]] for I in cup] Cur=cup The key +=k The else: Cur=v Key=k
Index +=1
For I in cur: If len (set (I))==7: Res=[key [i.i ndex (_)] for _ in TB] Print (res)