filmov
tv
Number of subsets with given difference | Dynamic Programming | 01 Knapsack

Показать описание
This video explains a very important dynamic programming interview problem which is to find the number of subsets with given difference.It is a variation of 01 knapsack problem and also a variation of subset sum problem.In this problem, given a set of elements, we are required to find the number of ways in which we can divide the set into 2 subsets so that the difference of their sum value is equal to the given difference.This problem can be converted to a much simpler problem of finding the number of ways to form a subset with given sum.I have shown the conversion of the problem with intuition and example.If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
========================================================================
Join this channel to get access to perks:
=======================================================================
USEFUL LINKS:
#dp #01knapsack #subset
========================================================================
Join this channel to get access to perks:
=======================================================================
USEFUL LINKS:
#dp #01knapsack #subset
Комментарии