Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 1227 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

Jelly, 4 bytes

œ?ØẠ

A monadic Link accepting an integer which yields a list of 52 characters.

The input range may be up to somewhat more than \$-2^{223} \leq n \lt 2^{223}\$ since \52ドル!>2^{224}\$.

Try it online!

How?

œ?ØẠ - Link: integer, n
 ØẠ - alphabet (Jelly's longest built-in character list containing no digits
 - or hyphen) = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
œ? - permutation at index (n) if all 4252! permutations were written out
 - in lexicographical order.
 - This indexing is modular so when n = -x we fetch the (52!-x)th entry.

So...

-2147483648 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONIGCDAMLJKFEHB
-2147483647 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONIGCDAMLJKFHBE
-2147483646 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONIGCDAMLJKFHEB
-2147483645 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONIGCDAMLJKHBEF
 ...
 -4 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDACB
 -3 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDBAC
 -2 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDBCA
 -1 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCAB
 0 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
 1 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 2 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxzy
 3 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyxz
 4 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyzx
 ...
 2147483644 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmrtxwznoqpsvyu
 2147483645 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmrtxwznoqpsyuv
 2147483646 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmrtxwznoqpsyvu
 2147483647 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmrtxwznoqpusvy

Jelly, 4 bytes

œ?ØẠ

A monadic Link accepting an integer which yields a list of 52 characters.

The input range may be up to somewhat more than \$-2^{223} \leq n \lt 2^{223}\$ since \52ドル!>2^{224}\$.

Try it online!

How?

œ?ØẠ - Link: integer, n
 ØẠ - alphabet (Jelly's longest built-in character list containing no digits
 - or hyphen) = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
œ? - permutation at index (n) if all 42! permutations were written out
 - in lexicographical order.
 - This indexing is modular so when n = -x we fetch the (52!-x)th entry.

Jelly, 4 bytes

œ?ØẠ

A monadic Link accepting an integer which yields a list of 52 characters.

The input range may be up to somewhat more than \$-2^{223} \leq n \lt 2^{223}\$ since \52ドル!>2^{224}\$.

Try it online!

How?

œ?ØẠ - Link: integer, n
 ØẠ - alphabet (Jelly's longest built-in character list containing no digits
 - or hyphen) = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
œ? - permutation at index (n) if all 52! permutations were written out
 - in lexicographical order.
 - This indexing is modular so when n = -x we fetch the (52!-x)th entry.

So...

-2147483648 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONIGCDAMLJKFEHB
-2147483647 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONIGCDAMLJKFHBE
-2147483646 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONIGCDAMLJKFHEB
-2147483645 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONIGCDAMLJKHBEF
 ...
 -4 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDACB
 -3 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDBAC
 -2 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDBCA
 -1 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCAB
 0 zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA
 1 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
 2 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxzy
 3 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyxz
 4 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyzx
 ...
 2147483644 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmrtxwznoqpsvyu
 2147483645 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmrtxwznoqpsyuv
 2147483646 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmrtxwznoqpsyvu
 2147483647 ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmrtxwznoqpusvy
added 410 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

Jelly, 4 bytes

œ?ØCØẠ

A monadic Link accepting an integer which yields a list of 4252 characters.

The input range may be up to somewhat more than \$-2^{168} \leq n \lt 2^{168}\$\$-2^{223} \leq n \lt 2^{223}\$ since \42ドル!>2^{168}\$\52ドル!>2^{224}\$.

Try it online! Try it online!

How?

œ?ØCØẠ - Link: integer, n
 ØCØẠ - consonantsalphabet (Jelly's longest built-in character list containing no digits
 - or hyphen) = "BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz""ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
œ? - permutation at index (n) if all 42! permutations were written out
 - in lexicographical order.
 - This indexing is modular so when n = -x we fetch the (4252!-x)th entry.

Jelly, 4 bytes

œ?ØC

A monadic Link accepting an integer which yields a list of 42 characters.

The input range may be up to somewhat more than \$-2^{168} \leq n \lt 2^{168}\$ since \42ドル!>2^{168}\$.

Try it online!

How?

œ?ØC - Link: integer, n
 ØC - consonants (Jelly's longest built-in character list containing no digits
 - or hyphen) = "BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz"
œ? - permutation at index (n) if all 42! permutations were written out
 - in lexicographical order.
 - This indexing is modular so when n = -x we fetch the (42!-x)th entry.

Jelly, 4 bytes

œ?ØẠ

A monadic Link accepting an integer which yields a list of 52 characters.

The input range may be up to somewhat more than \$-2^{223} \leq n \lt 2^{223}\$ since \52ドル!>2^{224}\$.

Try it online!

How?

œ?ØẠ - Link: integer, n
 ØẠ - alphabet (Jelly's longest built-in character list containing no digits
 - or hyphen) = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
œ? - permutation at index (n) if all 42! permutations were written out
 - in lexicographical order.
 - This indexing is modular so when n = -x we fetch the (52!-x)th entry.
added 410 characters in body
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293

Jelly, 4 bytes

œ?ØC

A monadic Link accepting an integer which yields a list of 42 characters.

The input range may be up to somewhat more than \$-2^{168} \leq 2^{168}\$\$-2^{168} \leq n \lt 2^{168}\$ since \42ドル!<2^{169}\$\42ドル!>2^{168}\$.

Try it online!

How?

œ?ØC - Link: integer, n
 ØC - consonants (Jelly's longest built-in character list containing no digits
 - or hyphen) = "BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz"
œ? - permutation at index (n) if all 42! permutations were written out
 - in lexicographical order.
 - This indexing is modular so when n = -x we fetch the (42!-x)th entry.

Jelly, 4 bytes

œ?ØC

A monadic Link accepting an integer which yields a list of 42 characters.

The input range may be up to somewhat more than \$-2^{168} \leq 2^{168}\$ since \42ドル!<2^{169}\$.

Try it online!

Jelly, 4 bytes

œ?ØC

A monadic Link accepting an integer which yields a list of 42 characters.

The input range may be up to somewhat more than \$-2^{168} \leq n \lt 2^{168}\$ since \42ドル!>2^{168}\$.

Try it online!

How?

œ?ØC - Link: integer, n
 ØC - consonants (Jelly's longest built-in character list containing no digits
 - or hyphen) = "BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz"
œ? - permutation at index (n) if all 42! permutations were written out
 - in lexicographical order.
 - This indexing is modular so when n = -x we fetch the (42!-x)th entry.
Source Link
Jonathan Allan
  • 115.4k
  • 8
  • 68
  • 293
Loading

AltStyle によって変換されたページ (->オリジナル) /