blob: 5b0c9317bc007df98fceac95bbaa93d7160fc0a8 (
plain)
1
2
3
4
5
6
7
|
def count_bidirectional(test_list):
res = 0
for idx in range(0, len(test_list)):
for iidx in range(idx + 1, len(test_list)):
if test_list[iidx][0] == test_list[idx][1] and test_list[idx][1] == test_list[iidx][0]:
res += 1
return (str(res))
|