Improving the time complexity of my back pack algorithm
OO is not always appropriate

In this case the class is not needed, just write a free standing function for simplicity.

Make the code speak, not the comments

For example:

# @param m: An integer m denotes the size of a backpack


Can be omitted if you write:

def backPack(backpack_size: int, ...):


and:

# @return: The maximum size


Can be omitted if you write:

def backpack_max_size(...):