โ† Amazon questions
CodingReported in a candidate post, Mar 2019

Sum of numbers with at least two set bits in O(N)

Filed under Amazon

Given an array of N integers, find the sum of all numbers whose binary representation has at least two set bits, with O(N) time complexity.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.