A naive approach to solve this problem would be to make all the possible combinations of nums or generate all subsets of nums that sum up to the required target.
This solution is very costly because the time complexity of achieving this is , where is the number of elements in nums, is the target, and ...
A naive approach to solve this problem would be to make all the possible combinations of nums or generate all subsets of nums that sum up to the required target.
This solution is very costly because the time complexity of achieving this is , where is the number of elements in nums, is the target, and ...