If curr_power is equal to target power we found a substring starting from index 0 and ending at index i .
if ( curr_power == power ) { document . write ( " " + " " + i + " " + power + " " ) ; return ; }