You are given an integer array nums.
Your task is to find the smallest missing positive integer that is strictly greater than the average of all elements in the array.
The average of the array is defined as:
average=
number of elements / sum of all elements
The answer must satisfy:
1. It is positive (greater than 0).
2. It is not present in nums.
3. It is strictly greater than the average of the array.
4. It is the smallest integer that meets these conditions.
â
Input: nums = [4, 8, 6]
Output: 7
Input: nums = [1, 3, 7, 9]
Output: 6
Accepted:
Submission: