Company: Palo Alto Networks SDE on campus_16march
Difficulty: medium
Bruce has an integer array A of size N . He must perform the undermentioned steps sequentially: Update the elements of array A with the square of each element. Find the binary equivalent of each element of the updated array. Find the number of set bits for all the elements in the updated array. Find two numbers (in decimal form) X and Y with the maximum and minimum number of set bits, respectively. Multiply the numbers (in decimal form) X and Y . Your task is to help Bruce find and return an integer value representing the nearest number which is a power of 2 that is greater than or equal to the product of X and Y. Note: The number of set bits means the number of 1's in a binary value. If two or more numbers have the same number of set bits, then the number with the lower decimal value is considered. A number that is a power of 2 can be expressed as 2 n , where 'n' is a positive integer. Input Specification: input1 : An integer value N, representing the size of the array A. input2 : An