# Tag Info

### Sort the months of the year

Jelly, 19 bytes 11ị“bMAanlseovc”iµÞ This is a monadic link that takes a list as argument and sorts it. Try it online! Background Jelly uses modular, 1-based ...
• 210k

### Output numbers up to 2^n-1, "sorted"

Python, 53 bytes f=lambda n,i=1:n*[f]and[i]+f(n-1,2*i)+i%2*f(n-1,i-~i) Try it online! The recursive function generates the sorted list as a pre-order walk down ...
• 145k
Accepted

### Find the longest word in an array

Imperative Tampio, 168 bytes ...
• 5,127
Accepted

### Count My Change

Japt, 5 3 bytes ñg9 Test it online! Explanation I, too, have added a sorting function to my language in the last few weeks :-) ...
Accepted

### Sort an Integer List

05AB1E, 2 bytes Code: œß Same algorithm as the Jelly answer. Computes all permutations of the input and pops out the smallest one. Try it online! A more efficient ...
• 44.4k
Accepted

Python 2, 58 54 bytes lambda x:sorted(x,key=lambda y,B10=0:eval(y[1:]+'10')) Try it online! How it works ...
• 68.8k

### DropSort it like it's hot

Haskell, 67 59 58 bytes (q:r)!x|x<last q=q:r!x|1<2=(q++[x]):r _!x=[[x]] foldl(!)[] Explanation: Given a list of lists (that are already sorted) and a value ...
• 8,679
Accepted

### Interleave strings

Jelly, 1 byte Z Try it online! The “transpose” built-in will do exactly this to a list of strings.
• 68.8k

### Enumerate each series of identical numbers in-place

JavaScript (ES6), 26 bytes 1-indexed. a=>a.map(o=x=>o[x]=-~o[x]) Try it online! Commented ...
• 193k

### Sort an Integer List

Jelly, 3 bytes Œ!Ṃ This generates all permutations of the input list, then selects the lexographically smallest permutation. Very efficient. Credits to @Adnan who ...
• 210k

### Ordering a list

APL, 2 bytes ⍋⍋ The “grade up” built-in, applied twice. Works if indexing starts at 0, which isn’t the default for all flavors of APL. Try it here! Why does ...
• 68.8k

### Sort digits by their first occurrence in pi

Python 3, 40 39 bytes 1 byte thanks to Jonathan Allan. lambda s:sorted(s,key="145926870".find) Try it online!
• 49.8k

### Pendulum Encoding

Python 3, 29 bytes lambda l:l[1::2][::-1]+l[::2] Try it online! Input: A sequence Output: The pendulum encoding of that sequence How Consider the sequence <...
• 8,373

### Find the longest word in an array

Python, 23 bytes lambda a:max(a,key=len) Try it online!
• 2,525

### Implement the Thanos sorting algorithm

Python 3, 38 42 39 bytes q=lambda t:t>sorted(t)and q(t[::2])or t Try it online! -3 bytes thanks to @JoKing and @...
• 3,785

### Integer Interpretator

Python 2, 50 bytes l=input() while l:s=set(l);print s;map(l.remove,s) Try it online! Repeatedly prints the unique of elements of the list, then removes one of ...
• 145k

### Help, I've mixed my week up!

Pyth, 7 bytes o%CN258 Try it online! Convert each string to a number via treating its ASCII codes as a base 256 number, then take that mod 258, and sort. This ...
• 42k
Accepted

### List of possible birth years of living humans

Pyke, 6 bytes wC7m- Try it here! w - 121 m- - for i in range(^): C7 - current_year-i (After ...
• 28.6k

### Sever-sort an array

JavaScript (ES6), 64 bytes f=([n,...a],z=[],q=[n,...z])=>a+a?n<a[0]?[...q,...f(a)]:f(a,q):q Recursion FTW! The basic algorithm in use here is to keep track ...

### Implement the Thanos sorting algorithm

R, 41 bytes x=scan();while(any(x-sort(x)))x=x[!0:1];x Try it online!
• 13.9k

### Driftsort an array

Ruby, 33 ->a{a.any?{a.sort==a.rotate!}&&a} a.any? fires up to once for each element in the array, except it stops (...
• 22.2k

### Output numbers up to 2^n-1, "sorted"

Jelly, 6 bytes Ḷ2*ẆS€ This qualifies for the imaginary bonus. Try it online! How it works ...
• 210k

### Sort digits by their first occurrence in pi

05AB1E, 10 9 7 bytes Saved 1 byte thanks to Leaky Nun noting that filtering out duplicates is unnecessary. Saved 2 bytes thanks to Adnan. žqRvy†J Try it online! ...
• 53k

### Find the longest word in an array

Haskell, 35 bytes -3 bytes thanks to Zgarb. foldl1(!) a!b|(a<$a)<(a<$b)=b|1<2=a Try it online! I like this code. You know why? Because Haskell ...
• 17.2k

### Sort a list and write some English!

Vyxal Dear Boss, Quite worryingly, the printer has stopped working. Please bring a hammer, a battleaxe and a potentiometer. Sincerely, Joe Try it Online! By ...
• 38.8k

### Sort a string, sort of

Pyth, 5 bytes s.T.g Test suite Very straightforward: Group and sort, transpose, concatenate. ...
• 42k

### Pendulum Encoding

brainfuck, 24 21 18 bytes ,[[<],[>],<]>>[.>] Try it online! Thanks to Jo King for -3 bytes ...
• 3,035

### Sort the months of the year

x86 machine code, 26 25 bytes Hexdump: ff 32 8b 01 34 c0 68 30 5f 43 01 59 f7 e1 91 5a 80 f2 c0 f7 e2 3b c8 d6 c3 Assembly code: ...
• 13.7k