XYZ Interview Question

Subset sum problem