Last active
August 30, 2016 14:45
-
-
Save ololobus/ff8ec73e9704ae424e1db5fd22809fb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
pattern = re.compile('(\d*)(00|11|22|33|44|55|66|77|88|99)(\d*)') | |
n = 0 | |
for i in range(1, 10000): | |
s = str(i) | |
if pattern.match(s): | |
n += 1 | |
print 9999 - n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment