mynameishandsome

Untitled

Jun 21st, 2021
823
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def ngua(n,k, ngu):
  2.     global huhu, kaka
  3.     huhu += str(ngu)
  4.     hix = huhu
  5.     if len(huhu) == n: kaka += [int(huhu)]
  6.     else:
  7.         if ngu-k >= 0: ngua(n,k,ngu-k)
  8.         huhu = hix
  9.         if ngu+k < 10 and k!=0: ngua(n,k,ngu+k)
  10.     return kaka
  11. def createNumber(n,k):
  12.     if n == 0: return []
  13.     global huhu,kaka
  14.     ngu = []
  15.     for i in range(1,10):
  16.         kaka = []
  17.         huhu = ""
  18.         ngu += ngua(n,k,i)
  19.     return ngu
RAW Paste Data