In this post, we will solve Utopian Identification Number HackerRank Solution. This problem (Utopian Identification Number) is a part of HackerRank Regex series.
Solution – Utopian Identification Number – HackerRank Solution
Python
import re p = re.compile('^[a-z]{0,3}[0-9]{2,8}[A-Z]{3,}') n = int(input()) for i in range(n): x = str(input()) if(len(re.findall(p, x)) > 0): print("VALID") else: print("INVALID")
Note: This problem (Utopian Identification Number) is generated by HackerRank but the solution is provided by CodingBroz. This tutorial is only for Educational and Learning purpose.