f | def joinseq(*sequence): | f | def joinseq(*sequence): |
n | list_seq: list = [[next(seq), seq] for seq in [iter(subseq) for subseq in sequence]] | n | list_seq = list([[next(seq), seq] for seq in [iter(subseq) for subseq in sequence]]) |
| while list_seq: | | while list_seq: |
n | symbal_min = list_seq[0][0] | n | symb_min = list_seq[0][0] |
| index = 0 | | index = 0 |
| for (i, (j, s)) in enumerate(list_seq): | | for (i, (j, s)) in enumerate(list_seq): |
n | if j < symbal_min: | n | if j < symb_min: |
| index = i | | index = i |
n | symbal_min = j | n | symb_min = j |
| try: | | try: |
| list_seq[index][0] = next(list_seq[index][1]) | | list_seq[index][0] = next(list_seq[index][1]) |
| except Exception as ex: | | except Exception as ex: |
| list_seq.pop(index) | | list_seq.pop(index) |
t | yield symbal_min | t | yield symb_min |