Search
Factor, 122 bytes USING: kernel sequences sequences.windowed ; IN: c : c ( s -- s ) dup length [ dup last [ = ] curry count ] rolling-map ;
Goruby, 38 bytes ->n{dw{$.+=1;$..mp{1.0/-~_1}.su<n};$.} This was not as much fun as I thought it would be, but it was fun enough to use once.
Python 3, 70 bytes def f(a): d={};r=[] for x in a:d[x]=d.get(x,0)+1;r+=[d[x]] return r Try it online!
Both tags and [FINALIZED] are problematic Problem with tags Having been shown the related meta post Separate the tags away from the Sandbox or delete the [finalized] tag I can now see that having...
Z80 Assembler, 50 bytes org 256 ld de,m ld c,9 jp 5 m:db"Hello, world!\r$" With assembler there's usually the problem which machine or operating system the program is for. I've chosen CP/M ...
C (gcc), 117 bytes b,r;f(char*s){char*p=s;for(;*p;p++)*p-=47+7*(*p>57),b=b<*p?*p:b;if(b<2)return p-s;for(;*s;s++)r*=b,r+=*s-1;return r;} Try it online!
C (gcc), 46 bytes printf(char*);main(){printf("Hello, World!");} printf(char*);(14 bytes) is better than #include <stdio.h>\n(19 bytes)
JavaScript, 31 bytes Outputs 0 for falsey and a non-zero value for truthy. If the 2 values must be consistent then replace the last * with && to output true instead. n=>(g=d=>d++&...
Implementation defines the language, so if you use extensions to a language, you should add + ... extensions to the header. E.g. for a C post using gcc extensions, the header begin with # C (gcc...
The C (gcc) implies extensions - it will only work with that specific compiler under it's default setting GNU17 (equivalent to -std=gnu17), which is mostly a superset of standard C. This also inclu...
graphical-output Usage info: Graphical output challenges involve outputting images or illustrations using graphics. Detailed wiki: (uses text from CGCC's) Graphical output challenges invol...
Python 3, 167 127 118 117 94 63 bytes def f(a,b): y=0 for z in range(len(a)):y+=a[z]*b**z print(y) Try it online! Close gap to @user's lambda answer! Golfed 40 bytes thanks to @user's...
C (clang), 47 45 43 bytes i,j;main(){for(;printf("%i ",i-=~j);j+=2);} Try it online! Golfed 2 bytes from inspiration of @Shaggy's answer. Golfed 2 bytes by @m90.
Abuse (as few) libraries (as possible) We don't want to use too much libraries when playing challenges. Sometimes, libraries aren't used at all in some answers in C. What if we want to shorten so...
Python 3, 34 bytes x=0;y=1 while 1:x+=y;print(x);y+=2 Try it online! 1 is the int equivalent to True, which helps save bytes.
Java (JDK), 150 bytes interface M{static void main(String[]a){int i=new java.util.Scanner(System.in).nextInt(),j=0;for(;i!=1;j++){i=i%2==1?i*3+1:i/2;}System.out.print(j);}} Try it online! Fr...