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