Created
December 19, 2016 04:40
-
-
Save hackerdem/50731d28c3d1278479309a51681ad903 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 sys,re | |
with open('C:/Users/erdem/Desktop/memories/newe.txt', 'r') as test_cases: | |
for test in test_cases: | |
if test in ['','\n']:pass | |
else: | |
v=re.search('([-;\w]+)', test).group(0) | |
vqq=';'.join(re.findall('([\d|\w]+-[\d|\w]+)', test)) | |
st='' | |
if vqq==v and 'END' in v and 'BEGIN' in v: | |
a=[] | |
st=re.search('(BEGIN-)([\d])',v).group(2) | |
check=re.findall('(-[\d]+)',v) | |
while st!='END' and st not in a: | |
a.append(st) | |
st=re.search('({}-)((END)|[\d]+)'.format(st),v).group(2) | |
if st=='END' and len(a)==len(check):print('GOOD') | |
else:print('BAD') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment