Skip to content

Instantly share code, notes, and snippets.

@hanjae-jea
Created July 31, 2021 07:25
Show Gist options
  • Save hanjae-jea/df0ce38b90bca518e4b7c2c468e51eec to your computer and use it in GitHub Desktop.
Save hanjae-jea/df0ce38b90bca518e4b7c2c468e51eec to your computer and use it in GitHub Desktop.
def verify(k: int, n: int, box):
for i in range(k):
s1 = set()
for n1 in range(n):
for n2 in range(n1 + 1, n):
s1.add(abs(box[i][n1] - box[i][n2]))
for j in range(i+1, k):
s2 = set()
for n1 in range(n):
for n2 in range(n1 + 1, n):
s2.add(abs(box[j][n1] - box[j][n2]))
if len(s1 & s2) > 0:
print(f"{i} 번째 상자, {j} 번째 상자, {list(s1 & s2)}")
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment