Duck Number
Basic Accuracy: 42.36% Submissions: 3573 Points: 1

A Duck number is a positive number which has zeroes present in it, For example 3210, 8050896, 70709 are all Duck numbers. A number with only leading 0s is not considered as Duck Number. For example, numbers like 035 or 0012 are not considered as Duck Numbers. A number like 01203 is considered as Duck because there is a non-leading 0 present in it.
The task is to check whether the given number N is a Duck number or not.

Examples:
Input : 707069
Output : It is a Duck number.
Explanation: 707069 contains a non-leading 0 .
Input : 02364
Output : It is not a Duck number.
Explanation: contains only leading 0.

Input : 
The first line of input contains an integer T denoting the Test cases. Then T test cases follow. 
Second line contains a string denoting value of N.

Output : 
Print YES if given number is duck number otherwise print NO.

Constraints :
1 ≤ T ≤ 30
1 ≤ Length of N ≤ 104

Input : 
3
0
10001
11111

Output :
NO
YES
NO

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.