The subset sum to target


why m i getting run error in first two cases?