Created
June 1, 2017 20:01
-
-
Save danielborowski/3f17bc6fd019129c94bc45d133b9e80e 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
def QuestionsMarks(s): | |
qnum = 0 | |
dig = 0 | |
has_10 = False | |
for ch in s: | |
if ch.isdigit(): | |
if int(ch) + dig == 10: | |
if qnum != 3: | |
return 'false' | |
has_10 = True | |
dig = int(ch) | |
qnum = 0 | |
elif ch == '?': | |
qnum += 1 | |
return 'true' if has_10 else 'false' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment