HashedIn by Deloitte Interview Question

sum of subset problem