Hot answers tagged

23 votes

Derivative of a product

Pip, 15 bytes aRL#aJ'+<>#aJ'' Attempt This Online! Explanation ...
user avatar
  • 31.6k
14 votes

Convert Alpha-3 to Alpha-2

JavaScript (Node.js), 253 bytes Saved 1 byte thanks to @MatthewJensen Expects a string in upper case. Returns an array of 2 characters. ...
user avatar
  • 165k
11 votes

Derivative of a product

Python, 54 bytes lambda s:((l:=len(s))*(l*"'"+-~l*(s+"+")))[-~l*~l::-l] Attempt This Online! Python, 56 bytes lambda s:((l:=-~len(s))*(l*(s+"+")+-~l*"'")...
user avatar
  • 5,600
10 votes

Who needs 8 bits for one character?

Vyxal, 19 bytes ¹żb:∩L∆ZĿf8ẇR8∆ZRvB Try it Online! ...
user avatar
  • 26.6k
10 votes

Derivative of a product

C (clang), 69 64 59 bytes -10 thanks to @Noodle9 and @ceilingcat l;f(char*a){for(l=0;a[l];)printf("+%.*s'%s"+!l,++l,a,a+l);} Try it online!
user avatar
9 votes

ASCII-Art n'th Root

Python, 143 bytes def f(a,b): A=len(str(-a))&-2;print(A*" ",len(str(b))*"_"+f"\n{a:<{A}}/{b} = {b**(1/a):.{A}}");p="\\" while A:A-=2;print(p+A*" &...
user avatar
  • 5,600
7 votes

Spell out an integer... in NDos' way

Python 3.8 (pre-release), 172 bytes ...
user avatar
  • 2,659
7 votes

Derivative of a product

Brainfuck, 87 84 bytes ...
user avatar
  • 377
6 votes

1, 2, Fizz, 4, Buzz

rSNBATWPL, 57 bytes for{i=1;i<101}$print{(("Fizz"*1>i%3)+"Buzz"*1>i%5)or++$i} RSNBATWPL, or Radvylf Should Not Be Allowed To Write ...
user avatar
6 votes

Golfing Expressions

Python 3.10 ...
user avatar
  • 2,297
6 votes

Who needs 8 bits for one character?

JavaScript (ES7),  124 122  117 bytes Expects (encoder_characters)(string), where string is passed as an array of characters. <...
user avatar
  • 165k
6 votes

Derivative of a product

Factor, 53 bytes [ dup length [1,b] [ cut "'"glue ] with map "+"join ] Try it online! If the order of each product doesn't matter: Factor, 43 ...
user avatar
  • 8,498
6 votes

ASCII-Art n'th Root

JavaScript (ES8),  158  156 bytes Expects (a)(b), where both arguments are strings. ...
user avatar
  • 165k
6 votes

ASCII-Art n'th Root

Lua, 205 203 188 bytes ...
user avatar
  • 409
6 votes

ASCII-Art n'th Root

Charcoal, 37 bytes θ⸿↘⊘⊕Lθ↑↗⊘⁺³Lθ⟦⭆η_⟧η = ﹪⁺⁺%.LθfXIη∕¹N Try it online! Link is to verbose version of code. Explanation: θ ...
user avatar
  • 142k
6 votes

Haplololololololology!

Jelly, 45 38 bytes ḷⱮjⱮƤ““ “-”ẎʋƤṖe@€i1ḣ@ȯ ŒṖÇƑÐḟẈṢṚƲÞṪÇ€ Try it online! Should be correct for real this time thanks to Tanner Swett. Should be correct for real ...
user avatar
5 votes

Spell out an integer... in NDos' way

Charcoal, 86 bytes ⊞υNWυ«≔⊟υι¿ι«≔⌕⮌÷¹⊕↨ιχ⁰θ≧÷Xχθι§⪪”↶0OP⊘ηS℅ê*k⮌⁰nI¿'⊗ξ!»NV”³ι≧÷χι⊞υι⊞υθ¿θ¿ιom¦eh¿ιat¦em→ Try it online! Link is to verbose version of code. ...
user avatar
  • 142k
5 votes

Shift a string gradually

Jelly,  7  6 bytes Thanks to @ovs for suggesting looking at swapping the argument order and hence saving a byte! J+i@€ị A dyadic Link that accepts the instruction ...
user avatar
5 votes

Shift a string gradually

J, 14 bytes [{~#@[|i.+#\@] Try it online!
user avatar
  • 26.5k
5 votes

Shift a string gradually

Pip, 15 bytes (b(b@?B)+U_MEa) Takes the two strings as command-line arguments. Attempt This Online! Explanation ...
user avatar
  • 31.6k
5 votes

Convert Alpha-3 to Alpha-2

05AB1E, 238 219 bytes ...
user avatar
5 votes

Convert Alpha-3 to Alpha-2

Wolfram Language (Mathematica), 115 bytes (uses builtin libraries) Turns out there's a builtin for everything! There was a restriction against using internet connectivity, so I'm not sure if the ...
user avatar
  • 1,074
5 votes

Shortest restricted superstring

Python, 150 bytes f=lambda D,R,m=min:m([h for d in D for e in f(D-{d},R,sorted)for x in range(len(d)+2)if(d in(h:=(d+"_")[:x]+e))>any(r in h for r in R)]or[""],key=len) Attempt ...
user avatar
  • 5,600
5 votes

Derivative of a product

Jelly, 14 bytes J‘œṖ€j€”'j”+”' Try It Online! ...
user avatar
  • 40.1k
5 votes

Derivative of a product

Wolfram Language (Mathematica), 45 36 bytes aRiffle[a/.#->#<>"'"&/@a,"+"]<>"" Try it online! Input ...
user avatar
  • 14.9k
5 votes

Derivative of a product

JavaScript (Node.js), 83 \$\cdots\$ 72 69 bytes s=>g=(r="",i=0)=>s[i]?g(r+("+"+s).slice(!i,++i+1)+"'"+s.slice(i),i):r Try it ...
user avatar
  • 17.8k
5 votes

Derivative of a product

JavaScript (Node.js), 46 44 bytes l=>[...l].map(s=>l.replace(s,s+"'")).join`+` Try it online! -2 bytes thanks to emanresu A
user avatar
  • 151
5 votes

ASCII-Art n'th Root

Python 3.8 (pre-release), 161 bytes ...
user avatar
  • 5,266
5 votes

ASCII-Art n'th Root

Julia 1.0, 137 bytes ...
user avatar
  • 4,804
5 votes

Haplololololololology!

Python 3.8 (pre-release), 196 bytes ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible