Write a template function that returns the largest value and
Solution
#include <iostream>
 #include <vector>
 using namespace std;
template<typename T>
 void myFunc( vector<T> input, vector<T> &minMax, vector<T> &reqList ){
    typename vector<T>::iterator it = input.begin();
    minMax.clear();
    reqList.clear();
    minMax.push_back( *it ); //minimum
    minMax.push_back( *it ); //maximum
    for( ; it != input.end(); it++ ){
        if( *it < minMax[0] ){ minMax[0] = *it; }
        if( *it > minMax[1] ){ minMax[1] = *it; }
       if( it + 1 != input.end() ){
            int left = *it;
            int right = *(it+1);
            if( left > right ){
                int temp = left;
                left = right;
                right = temp;
            }
            left++;          
            for(; left < right; left++){
                reqList.push_back( left );
            }
        }
    }
 }
int main(){
vector<int> input;
   input.push_back(5);
    input.push_back(2);
    input.push_back(3);
    input.push_back(6);
    vector<int> minMax, reqList;
   myFunc<int>(input,minMax,reqList);
    cout << \"Min: \" << minMax[0] << endl;
    cout << \"Max: \" << minMax[1] << endl;
    for(int i =0 ; i <reqList.size(); i++){
        cout << reqList[i] << \" \";
    } cout << endl;
 }

