Skip to content

Instantly share code, notes, and snippets.

@yzdann
Created April 5, 2020 20:46
Show Gist options
  • Save yzdann/da4352d936fb9c3339081b611b9e5e2c to your computer and use it in GitHub Desktop.
Save yzdann/da4352d936fb9c3339081b611b9e5e2c to your computer and use it in GitHub Desktop.
num_list = [2, 4, 1, 6, 40, 2, 24, 3, 1, 5, 6, 8, 12, 9, 31, 45, 7, 14, 19, 20]
count = 5
paritioned_list = []
for i in range(count-1):
paritioned_list.append(num_list[i*count:(i+1)*count])
two_d_4x4 = [
list(set(first_list).intersection(second_list))
for first_list in paritioned_list
for second_list in paritioned_list
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment