New answers tagged sorting
3
votes
1
vote
CGAC2022 Day 10: Help Santa sort presents!
Scala 3, 120 bytes
A port of @loopy walt's Python answer.
...
3
votes
CGAC2022 Day 10: Help Santa sort presents!
Nekomata, 9 bytes
ˡ{ᵗ≡ĭ?}aṀ
Attempt This Online!
...
1
vote
Pseudo-Quantum Bogosort
Charcoal, 40 bytes
⊞υ⟦⟧Fθ≔ΣEυE⁻Eθνκ⁺κ⟦μ⟧υFυUMι§θκEΦυ⁼ι⌊υ⭆¹ι
Attempt This Online! Link is to verbose version of code. Explanation:
...
1
vote
Pseudo-Quantum Bogosort
Python 3.8+, 75 bytes
lambda a:filter(min(p:=[*permutations(a)]).__eq__,p)
from itertools import*
An unnamed function that accepts a tuple and returns a generator....
1
vote
Pseudo-Quantum Bogosort
Factor + math.combinatorics, 49 bytes
[ <permutations> [ dup sort = ] parallel-filter ]
Attempt This Online!
...
2
votes
Pseudo-Quantum Bogosort
Nekomata, 3 4 bytes
Edit: +1 byte to fix (unobservable) mechanism-of-action, thanks to alephalpha.
↕:o=
Attempt This Online!
Nekomata seems well-suited for this.
...
2
votes
Pseudo-Quantum Bogosort
Husk, 5 bytes
fS=OP
Try it online!
Quite closely follows the description.
...
2
votes
Pseudo-Quantum Bogosort
Python, 77 bytes
lambda l:[x for x in permutations(l)if[*x]==sorted(x)]
from itertools import*
Attempt This Online!
Top 50 recent answers are included
Related Tags
sorting × 209code-golf × 175
array × 54
string × 38
code-challenge × 19
number × 18
sequence × 10
permutations × 10
restricted-complexity × 9
integer × 8
math × 6
popularity-contest × 5
random × 5
natural-language × 5
optimization × 5
ascii-art × 4
date × 4
matrix × 4
fastest-code × 4
path-finding × 4
stack × 4
arithmetic × 3
combinatorics × 3
restricted-source × 3
graph-theory × 3