Facebook Phone Screen New Grad Question
Anonymous User
1910

Given an array and an integer k. Find all subarrays that whose size is a power of 2 and sum between k to 2k so [k, 2k] is the range.

How would you solve this without iterating for every element, let's call the element i, and trying to create subarrays that of size 2^x, where x is some number? I feel like that is inefficient. Interested in any solutions though.

Comments (5)