text: If mid is equal i , check mid - 1 and mid + 1
code: if ( mid == i ) { if ( ( mid - 1 >= 0 ) && nums [ mid - 1 ] == x ) { Console . Write ( nums [ i ] + " , ▁ " ) ; Console . Write ( nums [ mid - 1 ] ) ; return ; } if ( ( mid + 1 < n ) && nums [ mid + 1 ] == x ) { Console . Write ( nums [ i ] + " , ▁ " ) ; Console . Write ( nums [ mid + 1 ] ) ; return ; } break ; }