Hello.
There is such a task. Suppose there is a number 150. There is an array with numbers [145, 5, 7, 148, 161,190,153, etc.].
How can you find out the nearest smaller and nearest larger number? (In this example, it should be the numbers 148 and 153.) I stuck with h.g. with this question. Thank you in advance.