Tap here to switch tabs
Problem
Submissions

Problem: Bitwise OR of All Subsequence Sums

Try to solve the Bitwise OR of All Subsequence Sums problem.

Statement

Given an integer array nums, return the bitwise $ ext{OR}$ of the sum of every possible subsequence of nums.

A subsequence is a sequence that can be derived from an array by deleting zero or more elements without changing the order of the remaining elements.

Note: The sum of an empty subsequence is defined as 00.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Bitwise OR of All Subsequence Sums

Try to solve the Bitwise OR of All Subsequence Sums problem.

Statement

Given an integer array nums, return the bitwise $ ext{OR}$ of the sum of every possible subsequence of nums.

A subsequence is a sequence that can be derived from an array by deleting zero or more elements without changing the order of the remaining elements.

Note: The sum of an empty subsequence is defined as 00.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤109\leq 10^9