XYZ interview question

Subset sum problem