Tap here to switch tabs
Problem
Submissions

Problem: Bitwise OR of Adjacent Elements

Bitwise OR of Adjacent Elements takes an integer array and returns a new array containing the bitwise OR of each neighboring pair.

Statement

Given an array of integers nums of size n, construct and return an array ans of size n −1- 1 where ans[i] is equal to nums[i] OR nums[i +1]+ 1] for every index i such that 0≤0 \leq i <n−1< n - 1.

Constraints:

  • 2≤2 \leq nums.length ≤100\leq 100

  • 0≤0 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Bitwise OR of Adjacent Elements

Bitwise OR of Adjacent Elements takes an integer array and returns a new array containing the bitwise OR of each neighboring pair.

Statement

Given an array of integers nums of size n, construct and return an array ans of size n −1- 1 where ans[i] is equal to nums[i] OR nums[i +1]+ 1] for every index i such that 0≤0 \leq i <n−1< n - 1.

Constraints:

  • 2≤2 \leq nums.length ≤100\leq 100

  • 0≤0 \leq nums[i] ≤100\leq 100