New answers tagged

0

05AB1E, 8 bytes œ.ΔlÇ¥dP Try it online or verify a few more test cases. Explanation: œ # Get all permutations of the (implicit) input-string .Δ # Find the first permutation which is truthy for: l # Convert it to lowercase Ç # Convert each character to its ASCII codepoint ¥ # Get the deltas / forward-differences of ...


0

05AB1E, 1 byte { Try it online or verify a few more test cases. Also works in 05AB1E (legacy) or 2sable, which are older versions of 05AB1E. Explanation: { # Sort the characters of the (implicit) input-string # (after which the result is output implicitly)


1

APL (Dyalog Extended), 8 bytes s⊇⍨⍋⌈s←⍞ Try it online! (If a function were OK, it would have been 5 bytes ⍋⍤⌈⊇⊢.) ⍋ can be controversial here, because the challenge says "built-in sorting functions not allowed" and ⍋, called "Grade", is definitely related to sorting but it doesn't sort the input by itself. Instead, it gives a list of ...


3

CJam Hi; Isaq \~O~/ (1) @O@ / \* *~50 Times! ;; WINNINGS ;; ;; ;; ;;] $10000O ;; p1 is "where Kings sit', according to Shakesphere or someone. All I know is that after 4 straight years of earning second in the national clown contest, it sure feels great to be on top for once. My clown ASCII art could use some work, but hopefully I did ...


4

05AB1E, 23 21 bytes This is my first 05AB1E program (In fact this is my first golfing using golfing language), so please, if you have any notes, tips or improvements - I would love to get some in the comments section. Program: `rs/î©\õ.gGs«N®%0Qi¶«}} Explaination: `rs/î©\õ.gGs«N®%0Qi¶«}} ` Push each element of the input to the ...


3

APL (dzaima/APL), 18 bytes Anonymous tacit infix lambda. Takes N as right argument and M as left argument. Prompts stdin for strings as list of character vectors. {,/⍺⍬⍴⎕,(⍺|-⍵)⍴⊂⍬} Try it online! {…} "dfn"; left and right arguments are ⍺ and ⍵:  ⊂⍬ enclose the empty list to treat it as a whole  (…)⍴ cyclically reshape it to the following length: ...


4

K (ngn/k), 15 bytes Anonymous lambda. Takes N, M, and strings as arguments. {,/'(&~y!!x)_z} Try it online! {…} lambda; x is N, y is M, z is strings:  (…)_z cut list of strings before the following indices:   !x enumerate strings   y! division remainder when divided by target number of lines   ~ mask indicating zeros   & indices of trues in mask  ,/' ...


Top 50 recent answers are included