counting solution to subset summation problem. runs waaaay faster than brute force method