Lucky Number Solution codechef
Chef buys a lottery ticket that has adigit code associated with it. He thinks that digit is his lucky digit and brings him good luck. Chef will win some amount in the lottery if at least one of the digits of the lottery ticket is .
Given three digits, , and of the lottery ticket, tell whether Chef wins something or not?
Input Format Lucky Number Solution codechef
- First line will contain , the number of test cases. Then the test cases follow.
- Each test case contains a single line of input, three space separated integers .
Output Format Lucky Number Solution codechef
For each testcase, output in a single line answer
"YES" if Chef wins a positive amount with the lottery and
"NO" if not.
You may print each character of the string in uppercase or lowercase (for example, the strings “yEs”, “yes”, “Yes” and “YES” will all be treated as identical).
Constraints Lucky Number Solution codechef
Sample Input 1 Lucky Number Solution codechef
3 0 0 0 7 8 9 2 7 7
Sample Output 1 Lucky Number Solution codechef
NO YES YES
Explanation Lucky Number Solution codechef
Test Case: Since no digit is equal to , Chef fails to win any amount in the lottery.
Test Case: Since the first digit is equal to , Chef will win some amount in the lottery.
Test Case: Since the second and third digit is equal to , Chef will win some amount in the lottery.