about summary refs log tree commit diff
path: root/codechef/jain.py
diff options
context:
space:
mode:
Diffstat (limited to 'codechef/jain.py')
-rwxr-xr-xcodechef/jain.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/codechef/jain.py b/codechef/jain.py
new file mode 100755
index 0000000..8601072
--- /dev/null
+++ b/codechef/jain.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python3
+from itertools import combinations
+
+for _ in range(int(input())):
+    print(sum(len(a | b) == 5 for a, b in combinations(
+        (set(input()) for d in range(int(input()))), 2)))