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.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Python
  3. Regex and Parsing
  4. Validating UID

Validating UID

Problem
Submissions
Leaderboard
Discussions
Editorial

ABCXYZ company has up to employees.
The company decides to create a unique identification number (UID) for each of its employees.
The company has assigned you the task of validating all the randomly generated UIDs.

A valid UID must follow the rules below:

  • It must contain at least uppercase English alphabet characters.
  • It must contain at least digits ( - ).
  • It should only contain alphanumeric characters ( - , - & - ).
  • No character should repeat.
  • There must be exactly characters in a valid UID.

Input Format

The first line contains an integer , the number of test cases.
The next lines contains an employee's UID.

Output Format

For each test case, print 'Valid' if the UID is valid. Otherwise, print 'Invalid', on separate lines. Do not print the quotation marks.

Sample Input

2
B1CD102354
B1CDEF2354

Sample Output

Invalid
Valid

Explanation

B1CD102354: is repeating → Invalid
B1CDEF2354: Valid

Author

[deleted]

Difficulty

Easy

Max Score

40

Submitted By

41379

Need Help?


View discussions
View editorial
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy