БГ
Size: a a a
БГ
𝕬
[(0,3), (4,7)] должен был выйти о_0А
py3
def gs_from_ps(pairs):
groups=[]
start,end=0,0
for(c_f,c_l),(n_f,n_l)in zip(pairs,pairs[1:]):
if(c_l==n_f):
end=n_l
else:
groups.append((start,end+1))
start=n_l
end=n_l
return groups
print(gs_from_ps([(0,1),(1,2),(4,5),(5,6)]))
[(0, 3)]
БГ
БГ
K
А
[(0,3)] если должно возвращаться [(0,3), (4,7)]?start=n_l так-что будет (5, х)БГ
start=n_l так-что будет (5, х)OМ
OМ
async def echo(message: types.Message):👑️
БГ
OМ
БГ
OМ
OМ
ᅠ
OМ
K