Element Hunt in the Array
Easy
2
29.4% Acceptance
Given an array of length and a target value , your objective is to determine the presence of within the array .
Input Specification
- The opening line should include two integers separated by a space, and — representing the length of the array and the target value, respectively.
- The subsequent line enumerates all elements contained within array .
Output Specification
Print "YES" if the target value is found within ; print "NO" if it is not.
Boundary Conditions
Example Scenarios
Scenario #1:
Input:
5 3 7 3 5 2 1
Output:
YES
Scenario #2:
Input:
5 10 7 3 5 2 1
Output:
NO