• + 0 comments
    # Python3
    
    def pickingNumbers(a):
        maxL = 0
        for e,i in enumerate(a):
          x = []
          x.append(i)
          A = a.copy()
          A.pop(e)
          for j in A:
            if j == x[0] or abs(j - x[0] == 1):
              x.append(j)
          if len(x) > maxL:
            maxL = len(x)
            
        
        return maxL