Search
HTML, 25 bytes <style>*{background:#000} Not really sure if this is a legal solution, but technically you can open it in your browser...
HTML, 28 Bytes <HTML style=background:#000> #000 is shorter than black and quote marks are officially required but browsers figure it out.
ESCR - not a golfing answer This isn't really an answer to the question, and it's not an attempt at golfing. However, it shows a cute trick for solving this problem that falls out of the way the ...
HTML, 31 Bytes <HTML style="background:black"> The best solution is frequently the easiest one.
This is a language specific challenge, for HTML only. Your answer is the content of a self contained HTML file, that when opened in a web browser gives a plain black page. Requirements The HTM...
Given a list of non-negative integers the function $f$ replaces every integer with the number of identical integers preceding it (not necessarily contiguously). So f [1,1,2,2,1,3,3] = [1,2,1,2,3,1...
Jelly, 10 bytes ṭŒcg/€ċ1=1 Try it online! A monadic link taking a list of three positive integers and returning 1 if they are Borromean coprimes and 0 if not. TIO link checks all of the test c...
Jelly, 45 bytes L‘ḃ5MḢ;‘$œṖƲḅ5aị¥⁸N1¦Sṭ “¢¦½2d‘Çȷ6¡iḃ5ị“IVXLC Try it online! A pair of links that takes an integer as its argument and returns a string with the shortest generalised Roman num...
Python 3.8, 117 bytes def f(l): r,s,t=0,0,0 while s<len(l):_,s,t,r=[t:=max(t,(s+i+h)*(h>i))for i,h in enumerate(l[s:])],t,0,r+1 return r Try it online! The idea is to find the le...
Haskell, 66 bytes -7 bytes thanks to Razetime import Data.Complex (\c->(<2).magnitude$(iterate(\z->z*z+c)c)!!16) I use the fact, that if the result is bigger than 2, it will be fore...
Python 3.8+, 219 bytes Short version: from itertools import combinations as c def m(w): for k in range(n:=len(w)): for y in c(range(n),k+1): s=[0]*n for x in y: for r in range(...
Ruby, 128 bytes ->x,y{g=->c{c.chars.join" ?"} !x[y]&&(x.match?(/.+#{g[y]}.+/)||(0...(y.size-1)).any?{x[/^#{g[y[0.._1]]}.+#{g[y[(_1+1)..]]}$/]})} Attempt This Online! bookends ar...
Swift, 114 bytes func y(x:String)->Int?{return ["I":1,"V":5,"X":10,"L":50,"C":100,"D":500,"M":1000].filter{$0.key==x}.first?.value} Try it online! Explanation + Non-Golfed Version The no...
C, 59 byte h(n){return n&4?n&2?5:n&1?1e3:n&8?50:500:n&2?100:n&1?1:10;} Old version, 60 byte: h(n){return n&4?n&2?5:n&1?1000:n&8?50:500:n&2?100:n&...
Haskell, 62 bytes (\n->(scanl(*)1$cycle[5,2])!!(length$takeWhile(/=n)"IVXLCDM")) No import needed. It just uses standard Prelude functions. scanl(*)1$cycle[5,2] will give you the infinit...
Python 3.8+, 51 byte lambda n:((i:="IVXLCDM".index(n))%2*4+1)*10**(i//2) Testing the code: f=lambda n:((i:="IVXLCDM".index(n))%2*4+1)*10**(i//2) for s in "IVXLCDM": print(s, f(s)) T...
The Universal Crossword has a set of guidelines for crossword puzzle submissions. In this challenge we are going to be concerned with their rules for hidden word themes. A hidden word clue consis...
You work at a beach. In the afternoon, the sun gets quite hot and beachgoers want to be shaded. So you put out umbrellas. When you put out umbrellas you want to shade the entire beach, with as few ...
Find the shortest representation of an integer in generalised Roman numerals. Since there is more than one way to generalise, only the following definition applies to this challenge. Definition T...
Vyxal, 12 bitsv2, 1.5 or 2 bytes øṘ Try it Online! or Try the entire test suite Bitstring: 000101111100 Very simply a built-in
Given a single character, which is a valid Roman numeral, output its value. Values There are 7 valid single character Roman numerals, with the following values: Character Value I...
SageMath, 68 66 64 Byte. 62 if you don't count the m= g=gcd;m=lambda a,b,c:min(g(a,b),g(a,c),g(b,c))<2or g(g(b,c),a)>1 Returns False for borromean coprimes and True for all other natural ...
Dyalog APL, 23 bytes {⍵+(⌈/+⌊/)10⊥⍣¯1⊢⍵}⍣⎕⊢1...