Sponsored
Use these hints if you're stuck. Try solving on your own first.
If X is the first i digits of the array as a binary number, then 2X + A[i] is the first i+1 digits.
Solve with full IDE support and test cases