If curr_power - power already exists in map then we have found a subarray with target power .
if ( map . has ( curr_power - power ) ) { document . write ( " " + ( map . get ( curr_power - power ) + 1 ) + " " + i + " " + power + " " ) ; return ; } map . set ( curr_power , i ) ; }