Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- int subsetXORSum(vector<int>& nums) {
- long long int ans = 0LL, p = 1LL;
- for(auto num : nums)
- ans |= num;
- p = (1LL<<(nums.size()-1));
- ans = ans * p;
- return ans;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement