Created
August 2, 2021 14:36
-
-
Save SarveshMD/d9d814655fe6ad0368c01792a66b432e to your computer and use it in GitHub Desktop.
Solution for a GeeksforGeeks puzzle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
samples = list() | |
for _ in range(int(input())): | |
samples.append(input().rstrip()) | |
alphabetsLower = 'abcdefghijklmnopqrstuvwxyz' | |
alphabetsUpper = alphabetsLower.upper() | |
numbers = '0123456789' | |
def test(sample, searchIn): | |
i = 0 | |
for char in searchIn: | |
i += 1 | |
if char in sample: | |
break | |
return i | |
for sample in samples: | |
i = test(sample, alphabetsLower) | |
if i == 26: | |
print("NO") | |
continue | |
i = test(sample, alphabetsUpper) | |
if i == 26: | |
print("NO") | |
continue | |
i = test(sample, numbers) | |
if i == 10: | |
print("NO") | |
continue | |
print("YES") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment