3 ms·
The subproblem is covering $0.00 (always possible), then covering $0.01, then covering $0.02, then covering $0.03, ... Yeah the time complexity is O(N*M), wher
by H8crilA 5y ago
The subproblem is covering $0.00 (always possible), then covering $0.01, then covering $0.02, then covering $0.03, ...
Yeah the time complexity is O(N*M), where N is the value of the target added up price (size of the unary representation), and M is the number of items.