Skip to content

Instantly share code, notes, and snippets.

@aakashjsr
Created August 23, 2019 17:11
Show Gist options
  • Save aakashjsr/c4d1caf86b7a494b27e75fb86cae2451 to your computer and use it in GitHub Desktop.
Save aakashjsr/c4d1caf86b7a494b27e75fb86cae2451 to your computer and use it in GitHub Desktop.
def match(template, ptr, char):
if ptr < len(template):
template_char = template[ptr]
if template_char == 'A' and char == 'T':
return True
if template_char == 'T' and char == 'A':
return True
if template_char == 'G' and char == 'C':
return True
if template_char == 'C' and char == 'G':
return True
return False
template = str(raw_input())
n = int(raw_input())
flow = []
while n:
n -= 1
flow.append(raw_input())
output = [0] * n
template_pointer = 0
flow_pointer = 0
while flow_pointer < len(flow):
if match(template, template_pointer, flow_pointer):
# case here
else:
flow_pointer += 1
print(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment