mynameishandsome

Untitled

Jun 18th, 2021 (edited)
526
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def loco(l,k):
  2.     if len(l)<= k-1:return 0
  3.     kaka = l[0]+loco(l[1:],k)
  4.     for i in range(1,k):
  5.         kaka = min(kaka, l[i] + loco(l[i+1:],k))
  6.     return kaka
  7. print(loco([20,30,40,25,15,20,28],3))
RAW Paste Data