Tap here to switch tabs
Problem
Submissions

Problem: Maximum OR

Try to solve the Maximum OR problem.

Statement

You are given a 00 indexed integer array nums and an integer k.

In a single operation, you can choose any element in nums and multiply its value by 22.

Return the maximum possible bitwise OR value of all elements in nums after applying this operation at most k times.

Constraints:

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

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

  • 1≤1 \leq k ≤15\leq 15

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum OR

Try to solve the Maximum OR problem.

Statement

You are given a 00 indexed integer array nums and an integer k.

In a single operation, you can choose any element in nums and multiply its value by 22.

Return the maximum possible bitwise OR value of all elements in nums after applying this operation at most k times.

Constraints:

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

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

  • 1≤1 \leq k ≤15\leq 15