impleting multiple stack and subset sum problems