Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

Filters
 
60%
+1 −0
Challenges Prove commutativity on this monoid presentation.

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 ...

posted 8d ago by m90‭

Answer
60%
+1 −0
Challenges Expand a greyscale/colour hex code

APL (Dyalog Classic), 31 bytes '#',{4=≢⍵:⍵[2 2 3 3 4 4]⋄6⍴1↓⍵} Try it online!

posted 3mo ago by Arpad Horvath‭  ·  edited 3mo ago by Arpad Horvath‭

Answer
60%
+1 −0
Challenges Find all unique quintuplets in an array that sum to a given target

Inspiration: Leetcode's [3Sum] linkLink on CG&CC Problem Given an array nums of n (not necessarily distinct) integers, and given a target number target, return an array of all of the unique...

2 answers  ·  posted 4mo ago by CrSb0001‭  ·  last activity 1mo ago by panadestein‭

Question code-golf array arithmetic
60%
+1 −0
Challenges Borromean coprimes

Python, 89 Bytes import math as m def f(*n):return m.gcd(*n)==1and all(m.gcd(a,b)!=1for a in n for b in n) Note: The outdated Python interpreter at tio.run won't run this code (nor the ungolfe...

posted 3mo ago by celtschk‭

Answer
60%
+1 −0
Challenges Find the IP address class

C (gcc), 55 bytes a;f(char*s){for(;atoi(s)&128>>a&&a<4;a++);return 65+a;} Try it online! Just call atoi and start masking with 0x80. If true, keep looping and next che...

posted 4mo ago by Lundin‭  ·  edited 4mo ago by Lundin‭

Answer
60%
+1 −0
Challenges Partial Sums of Harmonic Series

Vyxal, 7 bytes ɾĖ∑?≥)ṅ Try it Online! Vyxal has arbitrary-precision rationals, so this will never run into precision errors. ṅ # Find the first integer -----) # where ∑ # sum of...

posted 5mo ago by emanresu A‭

Answer
60%
+1 −0
Challenges Make $2 + 2 = 5$

BQN (CBQN), 9 bytes ++2⊸=∧=⟜2 This utilizes the "3-train"- any functions in the form w fgh x is turned into (w f x) g (w h x). In this case, 2⊸= and =⟜2 are functions that check if the right a...

posted 5mo ago by arutonee‭

Answer
60%
+1 −0
Challenges Expand a greyscale/colour hex code

Haskell + hgl, 32 24 bytes tlM$tk6<cy<fiI(rl2~<)eL3 Explanation tlM map a over the tail of the input ... fiI if ... el3 the length is 3 (rl2~<) repeat each letter in place twi...

posted 3mo ago by WheatWizard‭  ·  edited 3mo ago by trichoplax‭

Answer
60%
+1 −0
Challenges Expand a greyscale/colour hex code

Q/KDB+, 39 bytes {"#",?[4=count x;x 1 1 2 2 3 3;6#1_x]} Testing the function: q)cc:{"#",?[4=count x;x 1 1 2 2 3 3;6#1_x]} q)cc "#ABCDEF" "#ABCDEF" q)cc "#A" "#AAAAAA" q)cc "#AB" "#ABABAB...

posted 3mo ago by Arpad Horvath‭  ·  edited 3mo ago by Arpad Horvath‭

Answer
60%
+1 −0
Challenges Expand a greyscale/colour hex code

Japt, 13 12 bytes Î+6îUÅË+pUÊv Try it (includes all test cases) Î+6îUÅË+pUÊv :Implicit input of string U Î :First character + :Append 6î : M...

posted 3mo ago by Shaggy‭  ·  edited 2mo ago by Shaggy‭

Answer
60%
+1 −0
Challenges Borromean coprimes

BQN, 27 bytes •math.GCD{∧´∘⥊(1=𝔽´)∧1<𝔽⌜˜} Booleans in BQN are the integers 0‿1. Try all test cases on the: BQN online REPL

posted 1mo ago by panadestein‭  ·  edited 1mo ago by panadestein‭

Answer
60%
+1 −0
Challenges Partial Sums of Harmonic Series

BQN, 23 bytes {𝕩{𝕊⍟(𝕗>·+´∘÷1+↕)𝕩+1}1} This recursion is more complicated than it should, but I managed to keep it purely functional. I use a modifier to mimic passing a left argument, that's...

posted 1mo ago by panadestein‭

Answer
60%
+1 −0
Challenges Find all unique quintuplets in an array that sum to a given target

BQN, 31 bytes {⍷(+´⊸=⟜𝕩∧5=≠)¨⊸/⥊(↕2¨𝕨)/¨<∧𝕨}´ This block function returns the empty array ⟨⟩ if the conditions cannot be satisfied. It works by sorting the input list to prevent having to fi...

posted 1mo ago by panadestein‭

Answer
60%
+1 −0
Challenges Expand a polynomial

BQN, 15 bytes ⊢(«∘⊢-×)´˜1∾˜≠˜ A 3-train (fold with initial): we zero list of the same length as the input with a one appended (the base case), then for each root we do the multiplication by the...

posted 1mo ago by panadestein‭

Answer
60%
+1 −0
Challenges "Hello, World!"

Taxi, 183 bytes Go to Writer's Depot:w 1 r 3 l 2 l."Hello, World!"is waiting at Writer's Depot.Pickup a passenger going to Post Office.Go to Post Office:n 1 r 2 r 1 l.Go to Taxi Garage:s 1 l 1 l 2...

posted 24d ago by Lundin‭  ·  edited 24d ago by Lundin‭

Answer
60%
+1 −0
Meta A Code Golf specific favicon

The process to create a small icon from a big one, is to not just reduce its resolution by a standard downsample, but to recreate the icon from scratch with gradually fewer details. As your downsam...

posted 18d ago by Andreas demands justice for humanity‭

Answer
60%
+1 −0
Meta A Code Golf specific favicon

On main Codidact Meta there was a request for Unique favicons for each site. This has had a positive response and no objections (the nearest is one answer that says it should be opt in per communit...

1 answer  ·  posted 19d ago by trichoplax‭  ·  last activity 18d ago by Andreas demands justice for humanity‭

Question discussion
60%
+1 −0
Challenges 99 Shortened Bottles of Beer

JavaScript (V8), 185 bytes for(c=99;c;)print((f=(s=` on the wall`)=>`${c||99} bottle${~-c?`s`:``} of beer`+s)()+`, ${f``}. ${--c?`Take one down and pass it around`:`Go to the store and buy s...

posted 3y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Multiply two strings

Scala, 25 bytes a=>_.flatMap(a map _.min) Try it in Scastie! Pretty trivial solution, but here's a bad explanation anyway: //a is the first string a =>_.flatMap(a map _.min) //b is th...

posted 3y ago by user‭  ·  edited 3y ago by user‭

Answer
60%
+1 −0
Challenges In The Jailhouse Now

Sclipting, (UTF-16) 80 bytes 갰減먩놔 먩놦①復먩놗겮꺕똀 먩놬①復①增疊먩놣겮꺕똀會먩놣겮꺕떠 먩놩⑴復먩놝 Explanation Input n pushed on stack 갰減 Subtract 3 먩놔 "╔" 먩놦 "╦" ①復 String of above repeat...

posted 3y ago by Moshi‭

Answer
60%
+1 −0
Challenges Roll n fair dice

Jelly, 4 bytes X}€S Try it online! How it works X}€S - Main link. Takes n on the left, m on the right € - Over each element of 1 through n: } - With m as its argument: X - Y...

posted 3y ago by caird coinheringaahing‭

Answer
60%
+1 −0
Challenges Roll n fair dice

Vyxal ṪR, 3 bytes (⁰℅ Try it Online! ( # N times... ℅ # Generate a random integer between one and... ⁰ # First argument

posted 3y ago by emanresu A‭

Answer
60%
+1 −0
Challenges Roll n fair dice

Japt -mx, 3 bytes Takes n as the first input and m as the second. ÒVö Try it ÒVö :Implicit map of the range [0,first input) Ò :Negate the bitwise NOT of (i.e., increment) V ...

posted 3y ago by Shaggy‭  ·  edited 3y ago by Shaggy‭

Answer
60%
+1 −0
Challenges Multiply two strings

Haskell, 25 bytes f a=(>>= \c->map(min c)a) Try it online!

posted 3y ago by Hakerh400‭

Answer
60%
+1 −0
Challenges My house is destroyed! Can you make me one?

Python 3, 47 42 40 bytes -2 bytes thanks to bastolski lambda n:'#'*n+('\n#'+' '*(n-2)+'#')*~-n Try it online! Python's string multiplication is really useful.

posted 3y ago by Moshi‭  ·  edited 3y ago by Moshi‭

Answer