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
1.5k posts
 
50%
+0 −0
Challenges Determine whether an integer is square-free

Factor, 108 bytes USING: assocs kernel math math.primes.factors ; IN: s : ? ( n -- ? ) group-factors [ nip 2 < ] assoc-all? ;

posted 1y ago by gifti‭  ·  edited 1y ago by gifti‭

Answer
60%
+1 −0
Challenges Determine whether an integer is square-free

Myby, 12 5 bytes primf=primfd primf : prime factors = : equals primfd : unique prime factors Evaluated as a monadic fork in J (f y) g (h y). The test cases (retest...

posted 1y ago by south‭  ·  edited 1y ago by south‭

Answer
50%
+0 −0
Challenges Cumulative Counts

Vyxal, 4 bytes KƛtO Try it Online! Explained KƛtO Kƛ # For each prefix of the input tO # How many times does the tail occur in the prefix?

posted 2y ago by lyxal‭

Answer
75%
+4 −0
Challenges Find n Niven Numbers

Scala, 52 bytes Stream.from(1).filter(x=>x%(x+"":\0)(_+_-48)<1).take Try it in Scastie! Woo, 3 deprecation warnings! (okay, one of them could be fixed but I like to live dangerously) St...

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

Answer
50%
+0 −0
Challenges Make a frequency table (histogram)

Vyxal, 1 byte Ċ Try it Online! Yes, there really is a built-in for this.

posted 2y ago by lyxal‭

Answer
71%
+3 −0
Challenges Find n Niven Numbers

Vyxal, 4 bytes ‡∑Ḋȯ Try it Online! Explained ‡∑Ḋȯ ‡ ȯ # Find the first input numbers where: ∑ # The sum Ḋ # Divides that number

posted 2y ago by lyxal‭

Answer
81%
+7 −0
Challenges Find n Niven Numbers

Challenge A Niven number is a positive integer which is divisible by the sum of its digits. For example, 81 -> 8+1=9 -> 81%9=0. Your task is to find the first n Niven numbers, given n. Te...

7 answers  ·  posted 2y ago by Razetime‭  ·  last activity 1y ago by Shaggy‭

50%
+0 −0
Challenges Evens or Odds - you know this one

ESCR, 17 bytes show [and [in] 1] ESCR has no way to read from standard input (currently), so I assumed the existence of the function IN which magically returns the user input. Since the user i...

posted 2y ago by Olin Lathrop‭

Answer
50%
+0 −0
Challenges Evens or Odds - you know this one

Myby, 2 bytes %2 Input is taken from the command line implicitly. 0 for even, 1 for odd. Since Myby is still in its early stages, there is no online sandbox. Some test cases can be seen here.

posted 2y ago by south‭

Answer
50%
+0 −0
Challenges Cumulative Counts

Python 3, 74 bytes def f(a): d={x:0 for x in a};r=[] for x in a:d[x]+=1;r+=[d[x]] return r Try it online!

posted 2y ago by celtschk‭

Answer
50%
+0 −0
Challenges Cumulative Counts

Python 3.8 (pre-release), 69 bytes def f(x,y={},z=[]): for i in x:y[i]=y.get(i,0)+1;z+=[y[i]] return z Try it online! Bonus: theoretical answer if python allowed named assignment with su...

posted 2y ago by dino‭  ·  edited 1y ago by dino‭

Answer
50%
+0 −0
Challenges Cumulative Counts

J, 9 bytes 1#.]=&><\ This is the 7 byte APL solve but makes use of #. in place of +/"1. I came up with 1#.]=[\ first, but bubbler pointed out it breaks when non zeros are present. At...

posted 2y ago by south‭

Answer
50%
+0 −0
Challenges Cumulative Counts

J, 24 char ([: +/ [: (* +/\ )"1 ~. ="0 1 ]) Sample Runs ([:+/[:(*+/\)"1~.="0 1]) 1 1 2 2 2 1 1 1 3 3 1 2 1 2 3 3 4 5 1 2 ([:+/[:(*+/\)"1~.="0 1]) 3 7 5 4 9 2 3 2 6 6 1 1 1 1 1 1 2 ...

posted 2y ago by torres‭

Answer
50%
+0 −0
Challenges Make a frequency table (histogram)

Lua, 98 bytes function(t)r={}for k,v in pairs(t)do r[v]=0 end for k,v in pairs(t)do r[v]=r[v]+1 end return r end Attempt This Online!

posted 2y ago by Zakk‭

Answer
50%
+0 −0
Challenges Make a frequency table (histogram)

C (gcc), 45, 42 bytes t[9999];f(s,a)int*a;{for(;s;)t[a[--s]]++;} Try it online! Assumptions: Passing the array size to a function can be used as a means to deal with empty arrays (not s...

posted 2y ago by Lundin‭  ·  edited 2y ago by Lundin‭

Answer
60%
+1 −0
Challenges Make a frequency table (histogram)

J, 8 bytes ~.,:#/.~ Tacit function, this is the de facto method for this problem in J. Attempt it online!

posted 2y ago by south‭

Answer
60%
+1 −0
Challenges Make a frequency table (histogram)

Python 3, 38 36 33 bytes lambda x:{n:x.count(n)for n in x} -2 bytes thanks to @Razetime Another -3 bytes thanks to @orthoplex Attempt it online!

posted 2y ago by south‭  ·  edited 2y ago by south‭

Answer
50%
+0 −0
Challenges Make a frequency table (histogram)

APL(Dyalog Unicode), 4 bytes SBCS Anonymous tacit prefix function. ,∘≢⌸ Try it on APLgolf! …⌸ between each unique element and its indices, apply: ,∘≢ concatenate the unique element to the ta...

posted 2y ago by Adám‭

Answer
50%
+0 −0
Challenges Make a frequency table (histogram)

JavaScript (Node.js), 38 32 bytes -6 bytes thanks to Shaggy! a=>a.map(v=>d[v]=-~d[v],d={})&&d Try it online! Basically just this but returning the result

posted 2y ago by Moshi‭  ·  edited 1y ago by Moshi‭

Answer
71%
+3 −0
Challenges Make a frequency table (histogram)

Challenge Given an array in any suitable format, create a frequency table for it. i.e: Pair each unique element with the number of times it appears in the array. You can return the frequency tabl...

10 answers  ·  posted 2y ago by Razetime‭  ·  last activity 1y ago by Moshi‭

Question code-golf math
50%
+0 −0
50%
+0 −0
Challenges "Hello, World!"

JavaScript V8, 26 bytes console.log`Hello, World!`

posted 2y ago by danibarker‭  ·  edited 2y ago by danibarker‭

Answer
60%
+1 −0
Sandbox Code bowling using unique characters

posted 2y ago by Lundin‭  ·  edited 2y ago by Lundin‭

37%
+1 −3
Meta Rules for function submissions

Function parameters should not be allowed to be used in place of a return value. Reasons: Terms like return value and function result are explicitly specified as a specific, formal language i...

posted 2y ago by Lundin‭

Answer
50%
+0 −0
Challenges Keyword golfing

C (gcc), 358 bytes static inline _Noreturn float f(union u);extern _Thread_local _Complex long double*restrict B;main(void){_Atomic register enum {A};typedef _Alignas(unsigned char)struct S;_Sta...

posted 2y ago by Lundin‭  ·  edited 9mo ago by Lundin‭

Answer