Difference between syntaxes of declaring a 2D array in python

后端 未结 0 1265
梦如初夏
梦如初夏 2021-01-17 20:21

I tried coding 0/1 Knapsack Dynamic programming bottom-up approach in Python.

Code that I tried:

def knapSack(W, wt, val, n):
    matrix = [[0]*(W+1)]*         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题