Skip to content

Instantly share code, notes, and snippets.

@riceluxs1t
Created April 20, 2016 01:51
Show Gist options
  • Save riceluxs1t/d8193c7af0bfb417772be51f38b4c38d to your computer and use it in GitHub Desktop.
Save riceluxs1t/d8193c7af0bfb417772be51f38b4c38d to your computer and use it in GitHub Desktop.
variant = [[1,2,4,5,6],[7,8,10,11,12],[13,14,16,17,18],[19,20,22,23,24],[25,26,28,29,30]]
for a in variant:
row = a
next = row[1]
for i in row:
if next-i == 1:
if next == row[1]:
next = row[2]
elif next == row[2]:
next = row[3]
elif next == row[3]:
next = row[4]
elif next == i:
break
else:
print i+1
if next == row[2]:
next = row[3]
elif next == row[3]:
next = row[4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment