Tap here to switch tabs
Problem
Submissions

Problem: Bitwise OR of Adjacent Elements

med
30 min
Try to solve the Bitwise OR of Adjacent Elements problem.

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

med
30 min
Try to solve the Bitwise OR of Adjacent Elements problem.

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