Deloitte, Recently Asked Online Assessments in 2026 | Powers of Two Array Count & Sum

Question · Posted Apr 2026

Powers of 2 Array Count & Sum Problem Statement: Given an array Arr of N positive integers, write a program to print the: i) count C, which is the number of elements of Arr that can be expressed as a power of 2 such as 2^0, 2^1, 2^2, \dots ii) sum S, which is the sum of all the elements of Arr that can be expressed as a power of 2. Read the input from STDIN and print the output ...

The full answer & interview discussion are available to premium members.

Log in Create a free account