Posts by m90
Python 3.7, 231 bytes class C:pass def g(): async def f():return;yield;await[3for()in()];nonlocal f if None: with lambda:3or 7and 8as q:del x elif False:raise else:assert 1is not 5 try:...
JavaScript, 43 bytes s=>"ABCDE"[Math.log2(s.slice(0,3)^255|8)^7] Try it online! Taking the first 3 characters of the string is always enough to include the first octet, while including at...
Python, 88 bytes import abc,code,fcntl,graphlib,json,pickle,cmd,errno,heapq,re,struct,csv,pwd,xml,sys,bz2 Attempt This Online! Requires a Unix-like operating system for fcntl and pwd, and at l...
Python 3, 20 bytes lambda l:len({*l})<2 Try it online!
Python 3, 7 distinct characters, 11 bytes True/-~True Try it online!
JavaScript, 48 bytes _=>[..."41506372"].map(x=>1e8/9+10**x|0).join` ` Try it online! The string "41506372" encodes the position of the queen in each row. 1e8/9 gives 11111111.1111......
JavaScript, 102 bytes s=>[...x=s.split``].concat(x.reverse()).reduce((l,c,i,a)=>l+` `+(a[i+1]?c+' '.repeat(i-1)+c:a.join``)) The first part creates the 'mirrored' string in an array. red...
x86-64 machine code, 27 bytes 6A D7 58 99 B1 10 48 D3 C0 48 AB C6 07 0A AE 80 C1 48 73 F2 FF C2 74 EC 88 37 C3 Try it online! Following the standard calling convention for Unix-like systems (f...
x86-64 machine code, 32 bytes A4 FF CA 6A 06 58 F6 F2 50 3C 03 59 51 74 08 AC F3 AA FF CA 75 F5 F3 66 AD 66 F3 AB 58 B0 07 C3 Try it online! Following the standard calling convention for Unix-...
Cracks Shaggy's answer: Jelly “¿×⁶ṆḶN{N=ȷṾ» Try it online!
x86-64 machine code, 36 bytes 31 C0 8D 48 0A FF C0 50 99 89 17 48 F7 F1 01 17 99 85 C0 75 F6 58 50 F7 37 58 85 D2 75 E7 AB FF CE 75 E2 C3 Try it online! Following the standard calling conventi...
Python 3, 43 bytes lambda n:len({*map(str(n).count,str(n))})<2 Try it online!
Python 3.8, 64 bytes lambda s,_:((n:=s.count("1"))*"1"+"0"+n*"1010")*(len(s)-n)+n*"1" Try it online! Let Tn consist of (2n+1) 0s and 2n 1s alternating. Tn can consume a 1 on either side and ...
x86 machine code, 3 bytes 31 FF AB Try it online! In assembly: xor edi, edi stosd Set EDI to 0 by XORing it with itself, then use the 1-byte stosd instruction to try to write EAX to tha...
x86-64 machine code, 37 bytes 31 C0 50 50 FF 04 C4 AC 2C 30 79 F8 5A 48 B8 31 30 31 30 AE 51 F3 AB 59 51 F3 AA 88 27 59 FF CA 75 F1 88 17 C3 Try it online! Following the standard calling conve...