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