Search
C (compliant), 194 bytes 197 198 bytes. Golfed version of the function in the question, using X macros: #define L Y(1000,M)Y(900,CM)Y(500,D)Y(400,CD)Y(100,C)Y(90,XC)Y(50,L)Y(40,XL)Y(10,X)Y(9,IX...
Bash, 3 bytes rev Try it online! Less boring: Bash, 8 bytes tac -rs. Try it online!
This Q&A will be used as a general guide to cops-and-robbers challenges. It is not fully inclusive of every cops-and-robbers challenge but it's a good baseline. Basic Premise Cops and Robbers...
Bubblegum, 769 bytes 074cd1dc7fb6baed2f568915ffeb6aa5c775264a9a6f77eb418f0793da59b234599dadb6804269dbb5a213a05c807b0723f79512c284f46e8dbb6b0274f1b36606988b67ea58cf68beabe10f158702fcbf4c2b30d7b4f26...
Contestants should read from standard input and write to standard output. This is because almost all programming languages, including most esoteric programming languages, allow reading from standar...
Japt, 26 bytes aBcDeFgHiJkLmNoPqRsTuVwXyZ Try it Trivial Solution, 26 bytes ABCDEFGHIJKLMNOPQRSTUVWXYZ Try it Explanations In the first solution each lowercase letter is a method that ge...
This has probably been discussed before but I couldn't find any posts about it. I think we should re-make the sandbox category in the following way: Votes in the sandbox category should not c...
Haskell, 101 95 bytes import Data.List r a=or$map(a?)$(map read$tail.inits=<<tails(show a))\\[a] a?b=b/=0&&a`mod`b==0 Try it online! Changelog: Saved 4 bytes by replacing an...
Pyth, 16 bytes .^RtJ^2yTyJ%2S97 Try it online! This solution uses Euler's formula, which states that if a is coprime to m, a^(phi(m)-1) = a^-1 mod m where phi(m) is the totient function, t...
$N$ vessels initially contain $3$ stones each. What is the probability of having at least $3$ stones in the first vessel after moving a uniformly random selection from the first vessel to the secon...
In this challenge you will take an Irish word and a personal pronoun and create the possessive pronoun construction combining the two. For example sé, madra becomes a mhadra. Translated to English...
Python, 344 bytes 534 bytes: This is not golfed in any way. But it's the current winner! def validate_roman_numeral(candidate): invalid_strings = ["CCCC", "CCD", "CCM", "CDC", "CMC", "CMD",...
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...
The leaderboard that shows below a code golf challenge can either sort the answers to show the winner for each language separately (if "Group by language" is ticked) or it can show all the answers ...
Pyth, 6 bytes +!-Q2s Try it online! I think there might be a way to shave a byte, but I can't find it. s Sum the input + Add -Q2 Remove the twos from the input ! Nega...
You work in a kitchen which has a peculiar rule. When you mix something into a pot you must always add at least one new ingredient. So you can add pasta, oil, salt then pesto, but not pasta, pesto...
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(...
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...
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...
Japt v1.4.5 -!, 8 bytes à ËryÃa1 Try it or run all test cases à ËryÃa1 :Implicit input of array à :Combinations (with the original array first) Ë :Map r ...
TI-BASIC, 23 bytes Like lyxal's answer, this program exits immediately, so nothing after the Stop is executed. The program Stop GarbageCollectDetectAsymOffDispGraphiconj(BLACKClrfHomenormalpdf(...
BQN, 32 bytes (']'∾˜'['∾@+45+50↑79⥊˜·⌊×⟜50÷⊢)´ A tacit function. A pity, I had to add the parenthesis so I can fold the list of values that represent the fraction. Otherwise, assuming left and ...
Lean 4, 115 109 104 89 bytes Note: had to update bytecount to take into account non-printable characters. For anyone who isn't familiar with Lean, it's basically an interactive theorem prover t...