You are given an array of integers. Your task is to find and return the maximum and minimum elements present in the array.
Example 1
Input: arr[] = [1 5 6 7 9]
Output: Minimum = 1, Maximum = 9
Explanation: Not Needed
Example 2
Input: arr[] = [85 45 98 63 77]
Output: Minimum-45, Maximum-98
Explanation: Not Needed
Approach, complexity and clean code in every language. Sign in to unlock the editorial.
Your submissions, results and runtime history live here. Sign in to start your streak.
1 2 3 4 5
5 1
10 5 20 8
20 5