Skip to content

Instantly share code, notes, and snippets.

@rohanjai777
Created September 12, 2023 18:52
Show Gist options
  • Save rohanjai777/74cc7330e32f44881f834c9ce53ce1b7 to your computer and use it in GitHub Desktop.
Save rohanjai777/74cc7330e32f44881f834c9ce53ce1b7 to your computer and use it in GitHub Desktop.
public void getAllSubsets(int[] nums, int i, int xor){
if(i>=nums.length){
//any terminating condition
}
getAllSubsets(nums,i+1,xor^nums[i]);//picked
getAllSubsets(nums,i+1,xor);//not picked
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment