Subarrays with power-of-two length and sum between K and 2K
Given an integer array and k, find every contiguous subarray whose length is a power of two and whose sum lies between k and 2k. Use prefix sums so each candidate is checked in constant time, and give the total cost.
No answer yet. Write the first one; the best answer gets endorsed.
