Skip to content

Instantly share code, notes, and snippets.

@SarveshMD
Created August 2, 2021 14:36
Show Gist options
  • Save SarveshMD/d9d814655fe6ad0368c01792a66b432e to your computer and use it in GitHub Desktop.
Save SarveshMD/d9d814655fe6ad0368c01792a66b432e to your computer and use it in GitHub Desktop.
Solution for a GeeksforGeeks puzzle
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