/** * Problem link: https://practice.geeksforgeeks.org/problems/find-minimum-and-maximum-element-in-an-array4428/1 * * Problem statement: * Given an array A of size N of integers. Your task is to find the minimum and maximum elements in the array. * * Your task: * You don't need to read input or print anything. * Your task is to complete the function getMinMax() which takes the array A[] and its size N as inputs and returns the minimum and maximum element of the array. * * Expected Time Complexity: O(N) * Expected Auxiliary Space: O(1) */ /** * Driver code starts here */ #include using namespace std; #define ll long long pair getMinMax (long long input[], int n); int main () { int t; cin >> t; while (t--) { int n; cin >> n; ll input[n]; for (int i = 0; i > input[i]; } pair result = getMinMax(input, n); cout getMinMax (long long input[], int n) { ll minEl = input[0], maxEl = input[0]; for (int i = 1; i