- You are given a number n, representing the size of array a.
- You are given n distinct numbers, representing elements of array a.
- You are given another number d.
- You are required to check if d number exists in the array a and at what index (0 based).
- If found print the index, otherwise print -1
Example 1:
Input: 6 15 30 40 4 11 9 40 Output: 2
Constraints:
1 <= n <= 10^7
-10^9 <= n1, n2
.. n elements <= 10^9
-10^9 <= d <= 10^9