# Tag Info

### How many sorting networks?

Rust, $n = 6$ in ≈ 59 seconds The main simplifying observation here is that we don’t need to run the network on all $n!$ permutations; it suffices to run it on all $2^n$ binary strings. We can ...
• 39.2k

### Normal Subgroups of $S_4$

JavaScript (ES6), 23 bytes Expects a permutation of the string "4567" and returns 0 ... ...
• 186k

### Generate a permutation from the high-water marks

Nibbles, 5 bytes .,@?:-,_@@ Attempt This Online! Puts the $k$ highest numbers at the specified indices in ascending order and the remaining numbers at the ...
• 7,093

### Numbers with distinct decimal digits

Haskell, 37 bytes import Data.List nub$nub.show<$>[1..] Try it online! Takes each number, removes duplicate digits from its string representation while ...
• 144k

### Character insertion on letterboards

Jelly, 8 bytes ŒPUṚ;"Ɗi Try it online! Takes the letter-list $\sigma$ on the left and the target word $S$ on the right, returning a non-negative integer (...
• 20.2k

### CGAC2022 Day 6: Shuffles with specific "magic number"

J, 26 22 bytes ((=#"1-#@C.)#])!A.&i.] Try it online! -4 thanks to Bubbler! Generates all perms, converts to cycle representation, take sum of "length ...
• 32.4k

### First odd then even indices

K (ngn/k), 12 bytes #{x@<2!!#x}\ Try it online! { ... }\ Iterate until reaching the first value again (or a fixed point). ...
• 57.8k

### First odd then even indices

Thunno 2 L, 4 bytes µ¥zS Try it online! or verify all test cases µ¥zḞ Try it online! or ...
• 17.5k

### Normal Subgroups of $S_4$

Python NumPy, 26 bytes lambda A:(2*A-A@A).trace() Attempt This Online! Uses as the four distinct items the vectors ...
• 1,889

### Count N-Rich Permutations of an Integer Sequence

Husk, 9 bytes #mȯ▲mLġ>P Try it online! or Try the test lists with N=2 ...
• 33.6k

### First odd then even indices

J, 26 24 bytes i.~_:0}(\:2|#\)^:(3<@^#) Try it online! Accepts numeric lists The maximum number of iterations until we return to the input is bounded by Landau'...
• 32.4k

### Normal Subgroups of $S_4$

J, 14 bytes 5|1#.2^~#@>@C. Attempt This Online! Found while experimenting with the cycle decomposition of each permutation. Category 1 (...
• 72.7k

### Generate a permutation from the high-water marks

R, 23 bytes Edit: -9 bytes thanks to Command Master by switching to use a bitmask as input function(h)rank(h,,"f") Try it online! Input is simply a ...
• 33.6k

### How many sorting networks?

Rust, $n=6$ in roughly 50 48 43 41 23 seconds. Thanks to @AnttiP for a 44% speedup! My solution is based off of @AndersKaseorg's solution. I originally posted my changes as comments there, but with ...
• 41.7k

### How many sorting networks?

Rust, n=6 in ~12 1 second This answer is based on @Anders Kaseorg's solution and uses some of @isaacg's improvements. I got the answer 1,530,608,978,810 for n=7 in about 12 hours using more than 100 ...
• 2,521

### First odd then even indices

Jelly, 6 bytes ŒœẎ\$ƬL Try it online! Don't worry, the stack languages with single-byte uninterleave operators are going to be even shorter :P ...
• 20.2k

### Numbers with distinct decimal digits

J, 14 bytes ~.~.@":&>i.!14 Attempt This Online! (with 7 instead of 14) Uses xnor's idea: take unique digits from each number and then take unique ...
• 72.7k

### CGAC2022 Day 6: Shuffles with specific "magic number"

Python 3, 108 bytes f=lambda n,k,*a:n and sum([f(n-1,k-1,v,*a[:i],n,*a[i+1:])for i,v in enumerate(a)],f(n-1,k,n,*a))or[a]*(k==0) Try it online!
• 33.6k

### Generate a permutation from the high-water marks

Jelly,  4  2 bytes ỤỤ A monadic Link that accepts a bitmask identifying the high watermarks and yields a permutation. Try it online! Or see the test-suite. How? <...
• 102k

### Find Unique Anagrams

Jelly, 4 bytes Ṣ€Ḣƙ A monadic Link that accepts a list of lists and yields a list of lists containing the first of each anagram. Try it online! How? ...
• 102k

### Count N-Rich Permutations of an Integer Sequence

Ruby, 85 79 77 bytes Misread the prompt at first and was returning the permutations themselves instead of the amount, whoops. ...
• 12.4k

### Count N-Rich Permutations of an Integer Sequence

JavaScript (ES6), 87 bytes Expects (n)(array). ...
• 186k

### Count N-Rich Permutations of an Integer Sequence

Thunno 2 L, 10 bytes qæƑœØ^ḷG¹= Try it online! or verify all test cases Explanation ...
• 17.5k

### Count N-Rich Permutations of an Integer Sequence

Wolfram Language (Mathematica), 62 57 bytes Port of @chunes's Factor code in Mathematica. Saved 5 bytes thanks to the comment of @ZaMoC Golfed version. Try it online! ...
• 4,047

### First odd then even indices

05AB1E, 8 bytes vDÅ≠})Ùg Try it online or verify all test cases (the test suite uses the faster alternative ι˜ instead of ...
• 121k

### First odd then even indices

Google Sheets, 107 bytes =let(d,torow(A:A,3),_,lambda(_,a,n,sort(let(b,torow(wrapcols(a,2),3),if(and(b=d),n,_(_,b,1+n))))),_(_,d,1)) Put the input in cells ...
• 191

### Numbers with distinct decimal digits

05AB1E, 5 4 bytes ∞€ÙÙ Outputs an infinite list. Try it online. Explanation: ...
• 121k

### Permutapalindromic numbers

Japt, 13 bytes _ì á fÎdêQ}iU Try it 0-indexed ...
• 4,321