12 votes

Reconstruct an array by successive insertions

05AB1E, 11 bytes η@O<ø{.γн}¦ Try it online! Takes a list of numbers, 0 to 14, with o being 0, and ...
Command Master's user avatar
11 votes

I (rev)?(pal)? the source code, you (rev)?(pal)? the input!

Charcoal, 3 bytes θ⮌ω Try it online! Reversed: ω⮌θ Try it online! Palindromised: θ⮌ωω⮌θ ...
Neil's user avatar
  • 163k
8 votes

Implement Subleq

Python 3, 58 bytes def f(s,i=0):a,b,*r=s[i:];s[b]-=s[a];f(s,[i+3,*r][s[b]<1]) A recursive function that updates a Subleq program, the list of integers ...
Jonathan Allan's user avatar
8 votes

Do you win a Numeric Mahjong?

05AB1E, 47 47 44 41 38 bytes œʒ3ôʒ¥J>}gy3ôʒ¥T>SQ}g+3*Ig>Q}ćQ,¥›HUyy Try it online!, or try all test cases (this code can handle in under a minute). See ...
Command Master's user avatar
8 votes

I (rev)?(pal)? the source code, you (rev)?(pal)? the input!

JavaScript, 70 bytes (x=>x.at?x:y=>y+z(y))//)y+)y(z>=y:``nioj.)(esrever.]x...[?ta.x>=x=z( Try it online!
tsh's user avatar
  • 33.7k
7 votes

Reconstruct an array by successive insertions

Vyxal, 11 bytes 14ʁṘ(n~=T,o Try it Online! Takes a list of numbers, outputs 14 arrays containing the indices from n to ...
naffetS's user avatar
  • 12.2k
7 votes

Reconstruct an array by successive insertions

R, 41 bytes \(x)Map(\(i)which(x[x<=i]==i)-1,1:max(x)) How? ...
Dominic van Essen's user avatar
7 votes

I (rev)?(pal)? the source code, you (rev)?(pal)? the input!

05AB1E, 3 bytes ?R\ ?R\ - Try it online. \R? - .enilno ti yrT ...
Kevin Cruijssen's user avatar
6 votes

Do you win a Numeric Mahjong?

JavaScript (ES6),  143 122  119 bytes -24 bytes thanks to @tsh! Expects an Uint32Array. Returns a Boolean value. ...
Arnauld's user avatar
  • 186k
5 votes

Print every character your program doesn't have

Vyxal, 11 bytes I don't think I saw any Vyxal on here! Prints all printable ASCII with kQ and filters chars out with F kQ`\kQF\``F Try it Online!
ffseq's user avatar
  • 111
5 votes

Print a 10 by 10 grid of asterisks

makina, 51 bytes v ;0n<ICU >P>>>u?e ^>t>JUOO**********; ^<<<<<<>n9; I AM TOAST SMEAR ME WITH BUTTER
Toasty's user avatar
  • 51
5 votes

Reconstruct an array by successive insertions

JavaScript (ES6), 67 bytes Expects an array of integers in \$[1\dots15]\$. Returns an array of 14 arrays containing the insertion indices. ...
Arnauld's user avatar
  • 186k
5 votes

Print a 10 by 10 grid of asterisks

Trilangle, 35 bytes Control flow: yes. '8_',o9\v*<'.(".^(#/>o.<>,<..\()@#( zelda
bbrk bot's user avatar
5 votes

I (rev)?(pal)? the source code, you (rev)?(pal)? the input!

Python, 53 bytes -2 bytes, thanks to tsh s=input()# print(end=s)#)]1-::[s=dne(tnirp #)(tupni=s reads from standard input Attempt This Online! Python, 55 bytes <...
bsoelch's user avatar
  • 4,721
5 votes

I (rev)?(pal)? the source code, you (rev)?(pal)? the input!

R, 92 bytes x=el(strsplit(scan(,''),''))# cat(x,sep='')#)''=pes,)x(ver(tac #))'',)'',(nacs(tilpsrts(le=x Attempt This Online! Full program that reads input from ...
Dominic van Essen's user avatar
4 votes

Implement Subleq

JavaScript (ES6), 57 bytes Modifies the input array. f=(m,p=0)=>1/m[p]&&f(m,(m[m[p+1]]-=m[m[p]])>0?p+3:m[p+2]) Try it online! Commented ...
Arnauld's user avatar
  • 186k
4 votes

Reconstruct an array by successive insertions

Python3, 202 bytes: ...
Ajax1234's user avatar
  • 6,373
4 votes

Implement Subleq

x86(-64) machine code, 17 bytes A function that simulates a SUBLEQ machine with 8-bit cells, returning to the caller with the array modified. Callable from C with the x86-64 SysV calling convention ...
Peter Cordes's user avatar
  • 4,708
4 votes

I reverse the source code, you reverse the input!

J 9, 4 bytes ][.| Attempt This Online! See this answer for the 7-byter that works in previous versions. J 9 (re-)introduces modifier trains and adds some adverb ...
Bubbler's user avatar
  • 73.1k
4 votes

Interpret brainfuck

ReRegex, 12046 bytes ...
ATaco's user avatar
  • 10.2k
4 votes

Do you win a Numeric Mahjong?

Charcoal, 128 125 122 bytes ¿⁼²﹪L賫≔⟦⟧η≔⟦⟧ζW⌊⁻θη«⊞ηι⊞ζ⟦ι№θι⟧»⊞υζFυ¿⁼¹LΦι﹪§κ¹↔³P¹Fη¿⁼³LΦι×§λ¹›²↔⁻κ§λ⁰⊞υEι⟦§λ⁰⁻§λ¹›²↔⁻κ§λ⁰⟧»W›ηη«⊞⊞⌊⌊№№≔Φ﹪××⁻⁻¹EEFPPW∕» Try it ...
Neil's user avatar
  • 163k
4 votes

Reconstruct an array by successive insertions

Python 3, 74 bytes f=lambda x:sorted((i,sum(j<=i for j in x[:n]))for n,i in enumerate(x)if i) Takes input as integers: ...
Gprime's user avatar
  • 41
4 votes

I (rev)?(pal)? the source code, you (rev)?(pal)? the input!

Vyxal, 3 bytes ₴Ḃ_ Try! !yrT Try!!yrT !yrTTry! +1 very hard You uh sure about that? Explained ...
lyxal's user avatar
  • 31.4k
3 votes

Find the largest sum such that no two elements are touching

Scala 3, 69 bytes l=>{val(a,b)=l.foldLeft((0,0)){case((a,b),c)=>(a max b,a+c)};a max b} Attempt This Online!
138 Aspen's user avatar
  • 4,087
3 votes

Find the largest sum such that no two elements are touching

JavaScript (Node.js), 39 bytes a=>a.map(v=>q=(v+=p)>(p=q)?v:p,p=q=0)|q Try it online! Use two variables p, and ...
tsh's user avatar
  • 33.7k
3 votes

Find the largest sum such that no two elements are touching

Java, 64 57 bytes a->{int t=0,r=0;for(int k:a)r=(k+=t)>(t=r)?k:t;return r;} Another port of @G B's Ruby answer. Also runs in \$O(n)\$ complexity. Try it ...
Kevin Cruijssen's user avatar
3 votes

Don't google "google"

Vyxal, 8 bytes ɽ‛»¾=ßṀL Assumptions Program itself is the function g Program takes exactly one input "Google" being in the code page dictionary allows ...
ffseq's user avatar
  • 111
3 votes

Find the largest sum such that no two elements are touching

Befunge-98 (PyFunge), 60 67 bytes Rearranged Version, saves 7 bytes <v&v#gf;#e_f#;<j4`gffgfe<pff0pfe0 .>#<ffg+efpffp ^@ Try it online! ...
SquareFinder's user avatar
3 votes

Hello world!!! Fibonacci distribution

Vyxal , 8+13=21 bytes kh6⁽NV33C3ẋ#123456789 kh6⁽NV = Hello world 33C = ASCII 33 to ! 3ẋ = repeat top of stack three times (...
ffseq's user avatar
  • 111
3 votes

Reconstruct an array by successive insertions

Charcoal, 22 bytes ⊞υoW⌊⁻θυ⟦ιI⌕A⁻θ⁻θ⊞Oυιι Try it online! Link is to verbose version of code. Explanation: ⊞υo Start as if <...
Neil's user avatar
  • 163k

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