Luka profit maximum oyo ekoki kozuama na séquence ya ba transactions données?
 Array oyo epesami ezali komonisa ntalo ya stock na mikolo ekeseni, mpe mpo na kosala calcul ya profit maximale oyo ekoki kozwama, tokoki kolanda lolenge ya kosomba mpe koteka stock ntango nyonso oyo ntalo ya stock emati. Na maloba mosusu, tokosomba stock na minimum local mpe tokoteka yango na maximum local. Tala calcul ya profit maximum oyo ekoki kozuama na séquence ya ba transactions oyo epesami : 1. Somba na mokolo ya 1 (arr[0] = 100) pe koteka na mokolo ya 4 (arr[3] = 310), Profit = 310 -100 = 210. 2. Somba na mokolo ya 5 (arr[4] = 40) pe koteka na mokolo ya 7 (arr[6] = 695), Litomba = 695-40 = 655. Litomba mobimba = 210 + 655 = 865. Na yango, litomba ya likolo oyo ekoki kozwama na molongo ya misala oyo epesami ezali 865.