def solution(string,markers):
#your code here
def get_lines(string):
l = []
k = 0
while True:
t = string.find('\n', k)
if t >= 0:
l.append(string[k:t+1])
k = t + 1
else:
l.append(string[k:])
break
return l
lines = get_lines(string)
r = ''
for line in lines:
flag = False
t = ''
for e in line:
if e in markers:
flag = True
elif e == '\n':
t = t.rstrip()
flag = False
if not flag:
t += e
r += t
return r.rstrip()
网友评论