An array is special if there exists a number x such that exactly x elements of the array are greater than or equal to x (x need not be an array element). Return that x if it exists, otherwise -1. The value x is unique when it exists. Input: an array of non-negative integers.
Input: An array of non-negative integers.
Output: Integer — the value x, or -1.
Input: [0,4,3,0,4]
Output: 3
Explanation: Exactly 3 elements are >= 3.Input: [3,5]
Output: 2
Explanation: Two elements are >= 2.Input: [0,0]
Output: -1
Explanation: No valid x.1<=n<=1000<=value<=1000