solve subset and subset2