We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
test_cases = int(input())
for i in range(test_cases):
string = input()
upper_count=0
digits_count=0
for ele in string:
if ele.isupper():
upper_count += 1
elif ele.isdigit():
digits_count += 1
unique_count = len(string)==len(set(string))
if len(string)==10 and unique_count and string.isalnum() and upper_count >=2 and digits_count >= 3:
print('Valid')
else:
print('Invalid')
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Validating UID
You are viewing a single comment's thread. Return to all comments →
test_cases = int(input()) for i in range(test_cases): string = input() upper_count=0 digits_count=0 for ele in string: if ele.isupper(): upper_count += 1 elif ele.isdigit(): digits_count += 1
unique_count = len(string)==len(set(string)) if len(string)==10 and unique_count and string.isalnum() and upper_count >=2 and digits_count >= 3: print('Valid') else: print('Invalid')