If element is greater than 0
if ( key != 0 ) : NEW_LINE INDENT answer = ( answer % mod + powerOfTwo [ value - 1 ] ) % mod NEW_LINE DEDENT else : NEW_LINE INDENT answer = ( answer % mod + powerOfTwo [ value ] - 1 + mod ) % mod NEW_LINE DEDENT return answer NEW_LINE