Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

<upper_bound>_30-Seconds-of-C++

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 1.03 sec, absolute running time: 0.08 sec, cpu time: 0.02 sec, memory peak: 3 Mb, absolute service time: 1,12 sec 
edit mode |  history
 The array is : 5 6 7 7 6 5 5 6 8 
 So, we first sort the array

 The array after sorting is : 5 5 5 6 6 6 7 7 8 

Now, we find the upper bound on 6: 6


Now, we find the upper bound on 5: 3


Now, say we want to find upper bound for 8: 9
 
Now,for sets: 

The set elements are: 1 2 4 5 6 
The upper bound of key 2 is 4
The upper bound of key 3 is 4

    
                
λ
.NET NoSQL database for rapid development