Elements in the Range
Submissions: 3021   Accuracy:

40.54%

  Difficulty: Basic   Marks: 1

An array containing positive elements is given. ‘A’ and ‘B’ are two numbers defining a range. Write a function to check if the array contains all elements in the given range.

Input:
The first line of input contains an integer T denoting the number of test cases. Each test case contains space separated integers n, A and B which denotes the number of elements in the array a[] and the range [A, B]. Next line contains space separated n elements in the array a[].

Output:
Print "Yes" if all the elements in the range are present else print "No".

Constraints:
1<=T<=100
1<=n<=1000
1<= A < B<=1000
1<=a[i]<=1000‚Äč

Example:
Input:

1
7 2 5
1 4 5 2 7 8 3

Output:
Yes

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Shashwat Jain
Author: shashwat jain


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.