// Each optimal pseudoknot order solution is represented in
// dot-bracket-notation
notations = [""]*len(pseudoknot_order)
for s, solution in enumerate(pseudoknot_order):
// Bases whose partners have an opened bracket
opened_brackets = set()
After Change
// Each optimal pseudoknot order solution is represented in
// dot-bracket-notation
notations = [
bytearray(("."*length).encode()) for _ in range(len(pseudoknot_order))
]
for s, solution in enumerate(pseudoknot_order):
for basepair, order in zip(basepairs, solution):
notations[s][basepair[0]] = _OPENING_BRACKETS_BYTES[order]
notations[s][basepair[1]] = _CLOSING_BRACKETS_BYTES[order]