summaryrefslogtreecommitdiff
path: root/progs/dont_care/a29.py
blob: c5f976ca6b60a733c4023d57dc92df1b3f5cb5d0 (plain)
1
2
3
4
5
6
7
8
9
def adjac(ele, sub = []): 
  if not ele: 
     yield sub 
  else: 
     yield from [idx for j in range(ele[0] - 1, ele[0] + 2) 
                for idx in adjac(ele[1:], sub + [j])] 
def get_coordinates(test_tup):
  res = list(adjac(test_tup))
  return (res)