interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / tasks / sort-disjoint-sublist / oracle.py

10 lines · 359 bytes Raw Blame History
1# Independent reference for "Sort disjoint sublist" (Python 3, standard library only).
2# expected.txt is this program's stdout; omc never produced it.
3values = [7, 6, 5, 4, 3, 2, 1, 0]
4indices = [6, 1, 7]
5print(*values)
6print("indices:", *indices)
7ix = sorted(set(indices))
8for i, v in zip(ix, sorted(values[i] for i in ix)):
9 values[i] = v
10print(*values)