© 2026 Hashnode
Given an integer array nums containing distinct positive integers, find and return any number from the array that is neither the minimum nor the maximum value in the array, or -1 if there is no such number. Return the selected integer. Example 1: Inp...

Given an array arr[]. Your task is to find the minimum and maximum elements in the array. Examples: Input: arr[] = [1, 4, 3, -5, -4, 8, 6] Output: [-5, 8] Explanation: minimum and maximum elements of array are -5 and 8. Input: arr[] = [12, 3, 15, 7,...
