given an integer array divide the array into 2 subsets a and b while respecting