Given an unsorted array of n elements, find if the element k is present in the array
Question:
Given an unsorted array of n elements, find if the element k is present in the array or not. Complete the find-Number function. It has 2 parameters:
1. An array of integers, arr, denoting the elements in the array.
2. An integer, k, denoting the element to be searched in the array.
The function must return a string "YES" or "NO' denoting if the element is present in the array or not.
Input format: The first line contains an integer n, denoting the number of elements in the array arr. Each line i of the n subsequent lines {where 0 <_i<n) contains an integer describing arr; The next line contains an integer, k, the element that needs to be searched.
Constraints:
1<_n<_10^5
1<_arr[i]<_10^10
Output Format: The function must return a string "YES" or "NO" denoting if the leement is presend in the array or not.
Sample input 0
5,1,2,3,4,5,1
Sample Output 0
YES
Explanation 0: Given the array=[1,2,3,4,5], we want to find the element 1 if it is presend or not. We can find the element 1 at index=0 Therefore we print "YES"