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.
defis_valid_uuid(uuid:str):# There must be exactly 10 charactersiflen(uuid)!=10:returnFalse# It should only contain alphanumeric charactersifnotuuid.isalnum():returnFalse# No character should repeat.iflen(set(uuid))!=10:returnFalseuppercase_n=0digit_n=0forletterinuuid:ifletter.isdigit():digit_n+=1elifletter.isupper():uppercase_n+=1# Min 2 uppercase# Min 3 digitreturnuppercase_n>=2anddigit_n>=3if__name__=='__main__':n=int(input())for_inrange(n):ifis_valid_uuid(input()):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 →