Skip to content

Instantly share code, notes, and snippets.

@Blank1611
Last active September 30, 2019 16:13
Show Gist options
  • Save Blank1611/770262723e7aaf1d774062a695493e40 to your computer and use it in GitHub Desktop.
Save Blank1611/770262723e7aaf1d774062a695493e40 to your computer and use it in GitHub Desktop.
def match_skill(sb_lst):
loc_count = 0
for i in range(1,len(sb_lst)):
set_diff = set(sb_lst[0]).difference(sb_lst[i])
print("set_diff: ", set_diff)
sym_diff = set(sb_lst[0]).symmetric_difference(sb_lst[i])
print("sym_diff: ", sym_diff)
if ((len(set_diff) == 0) and (set_diff != sym_diff)) or ((len(set_diff) > 0) and (set_diff == sym_diff)):
loc_count += 1
elif (len(set_diff) > 0) and (set_diff != sym_diff):
loc_count += 2
return loc_count
def teach_me(N, skil):
count = 0
for i in range(N):
if i == (N-1):
break
print("skil_slice: ",skil[i:])
count += match_skill(skil[i:])
return count
start_time = time.time()
T = int(input())
for i in range(T):
C = []
N, S = map(int, input().split())
for k in range(N):
a, *c = map(int, input().split())
C.append(c)
print("Case #{}: {}".format((i+1), teach_me(N, C)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment