Tap here to switch tabs
Problem
Submissions

Problem: Neither Minimum nor Maximum

med
30 min
Try to solve the Neither Minimum nor Maximum problem.

Statement

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. If no such number exists, return −1-1.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100

  • All values in nums are distinct

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Neither Minimum nor Maximum

med
30 min
Try to solve the Neither Minimum nor Maximum problem.

Statement

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. If no such number exists, return −1-1.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100

  • All values in nums are distinct