Fully refactored the rod cutting module. - #1169
Conversation
There was a problem hiding this comment.
A List[int] is more strict than a list of anything.
There was a problem hiding this comment.
Making a list[int] is too restrictive since the prices can be floats as well.
You can also have mixed prices like [1, 1.2, 3].
If values which do not work well with addition are provided, then a ValueError will be thrown. That's something a user should handle, I think.
Edit: Also, the return type can be float or int depending on the prices.
There was a problem hiding this comment.
Making a
list[int]is too restrictive since the prices can befloatsas well.
You can also have mixed prices like[1, 1.2, 3].If values which do not work well with
additionare provided, then a ValueError will be thrown. That's something a user should handle, I think.Edit: Also, the return type can be
floatorintdepending on the prices.
@cclauss, do you insist that I enforced the values of the prices to be integers?
There was a problem hiding this comment.
Nope. I am fine with supporting both int and float
This reverts commit 2dfe01e.
* changing typo * fully refactored the rod-cutting module * more documentations * rewording

No description provided.