Skip to content

Instantly share code, notes, and snippets.

@danielborowski
Created June 1, 2017 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielborowski/3f17bc6fd019129c94bc45d133b9e80e to your computer and use it in GitHub Desktop.
Save danielborowski/3f17bc6fd019129c94bc45d133b9e80e to your computer and use it in GitHub Desktop.
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