Minimum element left from the array after performing given operations | C ++ implementation of the approach ; Function to return the minimum possible value of the last element left after performing the given operations ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int getMin ( int arr [ ] , int n ) { int minVal = * min_element ( arr , arr + n ) ; return minVal ; } int main ( ) { int arr [ ] = { 5 , 3 , 1 , 6 , 9 } ; int n = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; cout << getMin ( arr , n ) ; return 0 ; }