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