You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Problem link: https://practice.geeksforgeeks.org/problems/find-minimum-and-maximum-element-in-an-array4428/1
3
+
*
4
+
* Problem statement:
5
+
* Given an array A of size N of integers. Your task is to find the minimum and maximum elements in the array.
6
+
*
7
+
* Your task:
8
+
* You don't need to read input or print anything.
9
+
* 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.
10
+
*
11
+
* Expected Time Complexity: O(N)
12
+
* Expected Auxiliary Space: O(1)
13
+
*/
14
+
15
+
/**
16
+
* Driver code starts here
17
+
*/
18
+
#include<bits/stdc++.h>
19
+
20
+
usingnamespacestd;
21
+
22
+
#definelllonglong
23
+
24
+
pair <longlong, longlong> getMinMax (longlong input[], int n);
0 commit comments