Skip to content

Instantly share code, notes, and snippets.

View pabloroldan98's full-sized avatar
:shipit:

Pablo Roldan pabloroldan98

:shipit:
View GitHub Profile
@USM-F
USM-F / MCKP.py
Last active April 19, 2024 01:45
Dynamic programming solution of Multiple-Choice Knapsack Problem (MCKP) in Python
#groups is list of integers in ascending order without gaps
def getRow(lists, row):
res = []
for l in lists:
for i in range(len(l)):
if i==row:
res.append(l[i])
return res