Posts by Hakerh400
JavaScript (Browser), 670 bytes for(_="=1,w=):=0,w(=f(||(.join`w?q-w?q=-w(a,b=>A(L*5,a),g.innerText=N=L=D=T,I=,c,d)a-d?I,b(d,cd+1c,A=)I(a,(x,y)[...y,b(x)],[](U=_(Kf=({value:a})a==[a|]+[]&&a...
JavaScript (Node.js), 47 bytes f=(a,b=0,c=a=>a&&1/a+c(a-1))=>c(b)<a?f(a,b+1):b Try it online! For large numbers, a rounding error will occur and yield incorrect result. The ...
Haskell, 110 bytes f a=s>>=(#)$a++reverse a c@(a:b)!f=f c:b!f _!_=[] f#n=n!((n!).f) s(p:q)(d:e)(b:c)|e==c||e==[]=b|q==c=d|0<1=' ' Try it online!
JavaScript, 227 bytes (n,k,A,C=(a,b)=>a?[...C(--a,b),b(a)]:[],f=m=>m?C(n+1,i=>f(m-1).map(([p,s])=> [[...p,i],s+i])).flat():[[[],0]])=>f(k).map(([b,s])=>a=s-n?a:b.map((a,b)=>...
JavaScript (Node.js), 146 bytes f=(a,c=n=~(b=d=[],e=x=>x&&(c>191|d>2?b.push(d+192,c):b.push(...d+n?[c,c]:[c]),c=n,d=0)))=>(a.map(b=>c^n?c=(e(d>62|b-c),d++,b):(c=b,d=1))...
Haskell, 219 194 bytes h!n=x n?(a?c$d>n&&(even a?f(<)$f(==)))$h where(a,b)=e!!(c-1);(c,d)=dropWhile((<n).snd)e!!0;f g=g(n*2)$b+d x n=m?(2^(e-1)*(m+32))$e<1where(e,m)=divMod ...
Haskell, 352 bytes f a=let{(d,e)=y$filter(>'-')a;f=drop 1e;g=0!h;h=fst n;i=scanr(:)[]h;(j,k)=elem '.'f%(1!head(filter(\a->a>[]&&elem(a++a)i)i++[[last$'0':h]]));(l,m)=(read('0':d...
Haskell, 43 35 bytes main=interact$("Hello, "++).(++"!") Try it online!
Haskell, 78 bytes (!)0.(*2) i!n|i<n=(drop 3$(n-i)#' '++"_/"++i#'#'):(i+2)!n|0<1=[] (#)=replicate Try it online!
Haskell, 75 73 bytes -2 bytes thanks to @user f[]=1 f(x:y)=foldr(-)0$zipWith(\i->(*f[take i r++drop(i+1)r|r<-y]))[0..]x Try it online!
brainfuck, 40 bytes Outputs ÿ if all elements are equal, and \x00 byte otherwise. ->,>,[[-<->>+<]<[-<[-]>]>>[-<<+>>]<,]<<. Try it online! ...
Haskell, 221 215 bytes f=a 99 (#)=(++) a n=d n#", "#c".\n"n#b(n-1) b 0="Go to the store and buy some more, "#d 99#"." b n="Take one down and pass it around, "#d n#".\n\n"#a n c m n=show n#"...
Haskell, 116 bytes a#b=a!b:a++[a!"BOTTOM TEXT"] a!b=replicate(div(m a-k b)2)' '++b m=foldr1 max.map k k=length.dropWhile(==' ').reverse Try it online!
Haskell, 64 bytes main=do a<-getLine;putStr$"main=getLine>>=print.("++a++"+).read" Try it online! Run both programs
JavaScript (Node.js), 87 bytes f=(a,b=2,c=a-b,d=(a,b=2)=>b<a?a%b&&d(a,b+1):1,e=a=>d(++a)?a:e(a))=>d(c)?[b,c]:f(a,e(b)) Try it online!
JavaScript (Node.js), 80 bytes f=a=>a.map(a=>(a&=6,a-2?a-6?c+=1-a/2:d+=c+' ':c*=c,c*=c!=-1&c!=256),c=0,d='')&&d Try it online!
JavaScript (Node.js), 606 bytes for(_="=>\\\\ =j(...(a:').join`\\n`[q](/aa),/ / / d[c[___) .match(/.{.||]/g,=='.mapf=(n,m=([a,b]a?m(b)+a',l=10000n,j=, b,c=0a-c?[b(cj,b,c+1)]:[],b=[q='rep...
Bubblegum, 769 bytes 074cd1dc7fb6baed2f568915ffeb6aa5c775264a9a6f77eb418f0793da59b234599dadb6804269dbb5a213a05c807b0723f79512c284f46e8dbb6b0274f1b36606988b67ea58cf68beabe10f158702fcbf4c2b30d7b4f26...
JavaScript (Node.js), 70 56 bytes f=([a,...b],c=f)=>1/a?Math.max(f(b,c),[a]>c&&1+f(b,a)):0 Try it online!
JavaScript (Node.js), 53 bytes f=(a,b=[],c=a.map(([a,...c])=>(b+=[a],c)))=>b&&b+f(c) Try it online!
JavaScript (Node.js), 35 32 25 bytes -7 bytes thanks to @celtschk with(process)kill(pid,11) Try it online!
JavaScript (Node.js), 31 bytes f=(a,b)=>a<0?0:b<0?1:1+f(b,a-b) Try it online!
JavaScript (Node.js), 57 56 bytes f=(a,b='/\\')=>a--?''.padEnd(a)+b+` `+f(a,'/'+b+'\\'):'' Try it online!
- ← Previous
- 1
- 2
- 3
- Next →