Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .

0 like 0 dislike
3,253 views
in Online Assessments by Expert (32,020 points)

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 (32,020 points)
...