if value at this position less than x then updateposition Here ( 1 << i ) is similar to 2 ^ i .
if ( pos + ( 1 << i ) < n and presum [ pos + ( 1 << i ) ] < x ) : NEW_LINE INDENT pos += ( 1 << i ) NEW_LINE DEDENT