The author posted a question in Programming
Explain a problem in PascalABC.NET? and got a better answer
Response from
Response from 0[+++++]
A n= [1 4 8 10 30]; x= 9=> k= 4 between 8 and 10 if counting from 1 Go through the array and check the neighbors if x is greater than the previous and less than or equal to the current value from the array - we found k.
A n= [1 4 8 10 30]; x= 9=> k= 4 between 8 and 10 if counting from 1 Go through the array and check the neighbors if x is greater than the previous and less than or equal to the current value from the array - we found k.