46
votes
Scroll Word's font size selector
Word VBA, 199 147 126 116 102 100 87 85 Bytes
Why emulate when you can do?!
Declared function in the ThisDocument module that takes input ...
44
votes
Stretching Words
Brainfuck, 46 45 (63 with printable characters in input)
Compatible with Alex Pankratov's bff (brainfuck interpreter used on SPOJ and ideone) and Thomas Cort's BFI (used on Anarchy Golf).
The ...
30
votes
Bit run rundown
Python 2, 46 45 bytes
f=lambda n,k=1:`k`in bin(n^n/2)and-~f(n,k*10)
Try it online!
How it works
By XORing n and n/2 (dividing by 2 essentially chops off the ...
29
votes
Speed of Lobsters
convey, 59 47 bytes
{
?;\,&:1<
v^<^ ,<$1
"=>^}"@"}
>">>#="
'*'>:<=0
Try it online!
Run with ...
28
votes
Is there a single straight line in the matrix?
Python 2, 49 bytes
Takes as input a 2D binary matrix \$ a \$, and its size \$ n \$.
lambda a,n:sorted(map(sum,a+zip(*a)))[-2:]==[1,n]
Try it online!
There may be ...
25
votes
Universal Spooky Meme Translator
Ruby, 50 44 43 bytes
FGITW answer. Gotta go fast!
Thanks to @Neil for saving 6 bytes.
Oh right, crossed out 44 is still 44
...
24
votes
Make me a metasequence
Wolfram Language (Mathematica), 34 bytes
0~Range~19~Binomial~i~Sum~{i,0,#}&
Try it online!
The tier \$n\$ metasequence is the sum of the first \$n+1\$ ...
19
votes
Make me a metasequence
Haskell, 34 bytes
(iterate(init.scanl(+)1)[1..20]!!)
Uses 0-indexed inputs (f 4 returns tier 5.)
Haskell, 36 bytes
...
17
votes
Bit run rundown
Python 2, 46 bytes
f=lambda n,r=1:max(r,n and f(n/2,1+~-n/2%2*r))
Try it online
Extracts binary digits from n in reverse by ...
17
votes
What's my TIO uniqueness?
JavaScript (Node.js), 819 779 bytes
Returns 0 for undefined TIO uniqueness.
...
17
votes
Longest Zero Sum Sub-array
Python 3, 47 bytes
f=lambda x,*a:f(*a,x[1:],x[:-1])if sum(x)else x
Try it online!
It's simple breadth-first search, implemented recursively. The ...
16
votes
Speed of Lobsters
JavaScript (ES6), 35 bytes
Expects (haystack)(needle), where haystack is a list of characters and ...
15
votes
Universal Spooky Meme Translator
Perl, 36 34 bytes
s/\d+/"0|$&$^I"=~s#\^#**#r/gee
The source code is 30 bytes long and it requires the switches -pi (+4 ...
15
votes
All the k-mers/n-grams
Jelly, 1 byte
ṡ
Jelly has a single byte dyadic atom for this very operation
Try it online! (the footer splits the resulting list with newlines, to avoid a ...
14
votes
14
votes
14
votes
Even sum subarrays
Python 3.8 (pre-release), 57 bytes
f=lambda S,p=1:S>[]and f(S[1:])+sum((p:=p^s%2)for s in S)
Try it online!
Similar to brute-force method below but should have ...
14
votes
Check if the string is reshaped
Retina, 10 bytes
^(.+).*\1$
Try it online!
Works in any flavor of regex that supports backreferences.
14
votes
Output every sublist ... eventually
Haskell, 31 27 bytes
-4 bytes thanks to Wheat Wizard!
Takes an infinite list as input and returns each finite sublist an infinite number of times.
...
13
votes
Is it a circumfix?
J, 23 21 20 bytes
>&#*]e.1}:@}.-&#]\.[
Try it online!
-1 byte thanks to Bubbler
Return true if:
>&# left ...
13
votes
cadaddadadaddddaddddddr - linked list accessing
JavaScript (V8), 48 bytes
a=>f=b=>b[2]?b[[x,...r]=f(b.slice(1)),1]<f?x:r:a
Try it online!
-2 bytes thanks to @Arnauld!
13
votes
12
votes
Bring out the inner llama of a sentence
Perl, 52 bytes
The solution is provided as function that takes the string as argument and returns a list of positions.
One-based positions, case-sensitive search, without newlines: 52 bytes
...
12
votes
Bring out the inner llama of a sentence
sed, 299+1
Yes, sed can find a llama. No, sed can't do math. This is the longest answer so far, at 299+1 characters, because I had to teach sed to count.
This answer requires a sed with extended ...
12
votes
Stretching Words
C, 62 bytes
f(char*s,char*c){while(*s-*c||putchar(*c++),*s)putchar(*s++);}
Well, this is surprisingly competetive.
We define a function ...
12
votes
Fractal Smoke Sequence
Python 2, 95 bytes
l=[];n=input()
exec"a=min(set(range(n))-{2*b-c for b,c in zip(l,l[1::2])});print-~a;l=[a]+l;"*n
The main trick is in generating the ...
12
votes
Accepted
12
votes
Subsequence Substitution
Python 2, 88 bytes
def f(a,b,c,o=""):
for q in a:x=q==b[:1];o+=c[:x]or q;b=b[x:];c=c[x:]
print[o,a][c>'']
A function that takes in the three strings and ...
12
votes
Scroll Word's font size selector
JavaScript (ES6), 103 101 bytes
Takes input as an array of -1 / 1.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
subsequence × 108code-golf × 103
string × 38
sequence × 30
decision-problem × 15
array × 15
number × 10
integer × 8
fibonacci × 7
math × 6
binary × 4
fastest-algorithm × 4
arithmetic × 3
combinatorics × 3
matrix × 3
base-conversion × 3
counting × 3
set-partitions × 3
kolmogorov-complexity × 2
number-theory × 2
quine × 2
sorting × 2
optimization × 2
palindrome × 2
restricted-time × 2