HashedIn by Deloitte interview question

sum of subset problem