Help for this page

Select Code to Download


  1. or download this
    return $i if $A[$i] == $target && ($i == 0 || $A[$i-1] < $target);
    
  2. or download this
    return $i if $A[$i] == $target;
    
  3. or download this
    return $i if $A[$i] == $target && ($i == $#A || $A[$i+1] > $target);