Search
Embed ESCR, 16 characters [int n "base 2"] The INT function produces the text representation of an integer with lots of formatting options. The only non-default option needed was to set the numb...
J, 17 bytes {{*./y|~*:2+i.y}} Try it online! A direct definition closest to Razetime's infuriatingly good train solution. Outputs a non-zero number for true and 0 for false.
J, 3 bytes ,|. Try it online! This hook y f (g y) appends y with its reverse.
BQN, 107 bytes A↩C←A⇐¯π{_𝕣_:@;/⊏𝕩.y?𝕗‿∊𝕊⟨𝕤,⍷⟩𝕏𝕎𝔽𝕨𝔾𝕘}∞˙⌜˘¨´˝`(•Js⎉⊔⎊⌽⌾⍉⚇«∘»·∧○∨⍋⍒↑↓≍∾˜⥊⋈↕⊢⍟⊣¬!|≡≢/≥⟜≠=⊸≥⊐⊘⊒◶⊑><⌊⌈√⁼⋆+-×÷)⋄# BQN doesn't have keywords but primitive symbols are reserved. It's ...
MATL, 3 distinct, 3 total lH/ Try it online! Computes 1/2. Reserved labels for constants can be found here
MATL, 6 bytes YftuX= Try it online! Same method as Moshi. YftuX= Yf - factor with implicit input t - duplicate u - unique X= - isequal
Bash, 17 bytes echo x$1;./$0 x$1 Try it online! Thanks to celtschk for spotting my mistake :)
Embed ESCR, about 32 characters depending on how you count loop append s "*" show s endloop The indentation is not required, but shown for clarity. Declaring the variable S is also not ...
JavaScript (Node.js), 31 bytes for(i='';;console.log(i+='*')); Try it online!
C (gcc), 47 bytes i,n;f(){for(i=n+++2;i--;)putchar(i?42:13);f();} Try it online!
Lua 5.4.4, 147 bytes local function f()goto l::l::return end for _ in f do end if true and false then elseif""then else end repeat until""or not nil while""do break end Try it online! Check th...
C (gcc), 98 bytes _=0;f(char*s){for(;*s;++s)_==256||_<0?_=0:1,*s=='i'?_++:*s=='d'?_--:*s=='s'?_*=_:printf("%d ",_);} Try it online!
J, 28 bytes [:}.@{.m&(+/ .*)&m=.2 1,:1 0 Try it online! Tacit matmul solve. x&u&y applies x to y n times.
Rust, 236 184 166 142 bytes |i:u64|{let s=0x101010101010101;let(a,b,c,d)=(i&252*s,i&254*s,i&127*s,i&63*s);(i|a<<6|b<<15|c<<17|d<<10|d>>6|c>>15|b...
JavaScript (Node.js), 86 bytes X=>{Y=[];for(i in X)Y[i]=0,X.slice(i).map((a,b)=>a-X[b]?i='':Y[i]++);return Y.slice``} Attempt This Online! Using fancy notation, the time complexity is $...
Haskell + hgl, 30 bytes ic"|"<<tv(:".")><fl<ce '.'><eq Attempt This Online! Explanation This performs a cartesian product to get all possible ways to replace characters w...
Vyxal, 62 bitsv2, ~8 bytes ẏḋ\.vȦ\|j Try it Online! Really 7.75 bytes, but leaderboard regex is a thing. Explained ẏḋ\.vȦ\|j ẏ # Range [0, len(X)) ḋ # n-length combinations...
C (gcc), 152 bytes r;e(c){r=c=='j'?5:strchr("bdfghklpqy",c)?4:c=='i'?3:c=='t'?2:1;}c;s;f(char*i,char*o){s?(e(*i),c=r,e(*o)):(qsort(i,strlen(i),s=1,f),puts(i));return r-c;} Try it online! Out...
05AB1E, 3 bytes žÀà : implicit input žÀ : push "aeiouAEIOU" à : keep all elements of input that occur in "aeiouAEIOU" Try it online!
Golfscript, 8 6 bytes, 5 unique !).!(? Explanation: ! # negate , no value makes it 1 ) # increment -> 2 . # duplicate 2 ! # negate 2 = 0 ( # decrement -> -1 ? # exponentiate, 2^-1 =...