Subset Sum Easy

How to solve the problem using bitmasking.??
i solved it using the cumulative sum approach

First , create integer upto pow(2,size of array)-1 then run a for loop from 1 to max of created integer and sum the elemts at the index where index-th bit of i is 1 and at last of every iteration you check whether the given subset that you have chosen has sum equal to given sum or not.