If arr [ i ] = max then rightmost index for max will change
else if ( arr [ i ] == max ) = i ; } . WriteLine ( " Minimum ▁ left ▁ : ▁ " + leftMin ) ; . WriteLine ( " Minimum ▁ right ▁ : ▁ " + rightMin ) ; . WriteLine ( " Maximum ▁ left ▁ : ▁ " + leftMax ) ; . WriteLine ( " Maximum ▁ right ▁ : ▁ " + rightMax ) ; }