Untitled
unknown
python
2 years ago
420 B
2
Indexable
Never
def tasks(n,a,b): list_pair = [] for i in range(1,len(a)): list_pair.append([a[i],b[i]]) count = 0 for i in range(len(a)-1): tmp = list_pair[i].copy() tmp.reverse() if(tmp[0]==tmp[1] and list_pair.count(tmp)>1): count +=1 elif(tmp[0]!=tmp[1] and tmp in list_pair): count += 1 return int(n-count/2)