Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
2,416 views
in Online Assessments by Expert (34,270 points) | 2,416 views

1 Answer

0 like 0 dislike

Job role: Technology Developer FTE (Batch 2023)

 

Section 1 - Maximum OR (Coding, 20 mins)

 

Problem Statement: Given an array arr of n integers, in a single operation, choose any integer in the array and multiply it by 2.
Given arr and an integer num_operations, find the maximum bitwise OR of all the element of the array after performing the operations exactly num_operations times.

 

Example: n = 2, arr = [12, 9] and num_operations = 1
It is optimal to perform the operatino on 9 to get the array [12, 18]. The bitwise OR of the array is 1100 OR 10010 = 11110 which is the binary representation of 30, hence the answer is 30.

by Expert (34,270 points)