You are viewing a single comment's thread. Return to all comments →
print (bool(re.match(r'^[1-9][\d]{5}$',s) and len(re.findall(r'(\d)(?=\d\1)',s))<2 ))
In this just replcae blanks with re.math value, i.e -'^[1-9][\d]{5}$' and re.findall value with '(\d)(?=\d\1)' in the hackerrank IDE
Seems like cookies are disabled on this browser, please enable them to open this website
Decorators 2 - Name Directory
You are viewing a single comment's thread. Return to all comments →
print (bool(re.match(r'^[1-9][\d]{5}$',s) and len(re.findall(r'(\d)(?=\d\1)',s))<2 ))
In this just replcae blanks with re.math value, i.e -'^[1-9][\d]{5}$' and re.findall value with '(\d)(?=\d\1)' in the hackerrank IDE