Given a sorted array nums and a value x, find the ceiling of x in the array. The ceiling is the smallest element in the array that is greater than or equal to x. If no such element exists, return -1.
{
"nums": [
1,
2,
8,
10,
10,
12,
19
],
"x": 5
}8{
"nums": [
1,
2,
8,
10,
10,
12,
19
],
"x": 20
}-1{
"nums": [
1,
2,
8,
10,
10,
12,
19
],
"x": 0
}1Sign in to Run Code and Submit