Finding the first best candidate that is better than benchmark set .
for ( $ i = $ sample_size ; $ i < $ n ; $ i ++ ) if ( $ candidate [ $ i ] >= $ candidate [ $ best ] ) { $ best = $ i ; break ; } if ( $ best >= $ sample_size ) echo " Best candidate found is " . floor ( $ best + 1 ) . " ▁ with ▁ talent ▁ " . floor ( $ candidate [ $ best ] ) . " STRNEWLINE " ; else echo " Couldn ' t ▁ find ▁ a ▁ best ▁ candidate STRNEWLINE " ; }