Search in a decreasing array

Report a typo

Download the file. The first line contains an array of integers sorted in descending order. The second line contains the numbers you need to find in the first array. Change the search function so that it works on a decreasing array. As the answer, enter the results of the search for numbers from the second row in the array from the first row.

If the element is not found, return -1.

Sample Input 1:

29 28 26 25 24 23 22 21 19 18 17 14 11 10 9 8 7 4 3 0
1 2 7 9 11 14 25 26 27 28

Sample Output 1:

-1 -1 16 14 12 11 3 2 -1 1
Write code in your IDE to process the text file and display the results below
___

Create a free account to access the full topic