classSolution{publicintsubsetXORSum(int[] nums){returndfs(nums,0,0);}privateintdfs(int[] nums,int index,int total){// Reach the endif(index == nums.length)return total;// Include or not, to process all the subsetsint includeI =dfs(nums, index +1, total ^ nums[index]);int notIncludeI =dfs(nums, index +1, total);return includeI + notIncludeI;}}