Skip to main content
84 votes

Unique is Cheap

MATL, score 4 &=Rz Try it online! Explanation Consider input 'ABBA' as an example. ...
Luis Mendo's user avatar
  • 105k
17 votes

Unique is Cheap

Python, score 49 lambda S:sum(1+S.count(C)for[C]in S)/2 Try it online! There's a tab after in. Score breakdown: +27 ...
xnor's user avatar
  • 145k
13 votes

Count the shared substrings with 2 programs

Python, score 0, 520 bytes -25 from @Grain Ghost -78 from @Jonathan Allan -61 from @RootTwo -4 from @Grain Ghost ...
97.100.97.109's user avatar
12 votes

Count /[^a-z]/ig with /[a-z]/ig

Vyxal, score 0, 4 bytes kLFL Yes, you heard me right. Flagless, score 0, 4 bytes. Explanation ...
math scat's user avatar
  • 9,408
12 votes

Count /[^a-z]/ig with /[a-z]/ig

Charcoal -v, 36 bytes, score 0 CastLengthFilterqNotCountaUppercasei Try it online! Explanation: Charcoal's verbose parser is somewhat lax, not always requiring ...
Neil's user avatar
  • 172k
10 votes

Count /[^a-z]/ig with /[a-z]/ig

Husk, Score 0, 13 11 bytes* mLfopVDkDma Try it online! The basic idea is to filter for non-alphabetic characters and calculate the length. Husk has a builtin (<...
Dominic van Essen's user avatar
8 votes

Unique is Cheap

C (gcc), score:  113  103 100   96  91 Thanks to @ugoren, @CalculatorFeline, @gastropner, @l4m2, and @JS1 for their tips. ...
Steadybox's user avatar
  • 16.5k
8 votes

Unique is Cheap

T-SQL, score 775 579! 580 ...
BradC's user avatar
  • 6,787
8 votes

Count /[^a-z]/ig with /[a-z]/ig

05AB1E, score: 0 (7 bytes) ADuJSKg Try it online or verify all test cases. (The Join in the test suite has been replaced with a ...
Kevin Cruijssen's user avatar
8 votes

Count /[^a-z]/ig with /[a-z]/ig

Pip, score 0, 8 bytes oMSaRMXA Try It Online! -3 thanks to DLosc. ...
emanresu A's user avatar
  • 38.8k
7 votes

Unique is Cheap

Retina, score 34 s(O`. M&!`^|(?<=(.))\1* . Try it online! Explanation s(O`. We start by sorting all the characters ...
Martin Ender's user avatar
7 votes

Unique is Cheap

Haskell, score 42 f l=sum[1|c<-l,d<-c:l,d==c]/2 Try it online! Anonymizing \l-> gives the same score.
xnor's user avatar
  • 145k
7 votes

Unique is Cheap

JavaScript (ES6), score 81 78 Saved 3 points thanks to @Arnauld s=>s.replace(d=/./g,z=>q+=d[z]=-~d[z],q=0)&&q My original score-81 recursive ...
ETHproductions's user avatar
7 votes

Unique is Cheap

Jelly, score 6 ;\ċ"⁸S Try it online!
Leaky Nun's user avatar
  • 49.8k
7 votes

Everyone Ought to Have a Friend

Python 2, 0 (350 344 314 309 301 298 291 bytes) ...
TFeld's user avatar
  • 19.8k
7 votes

Longest Increasing Substring

Pyth, score 2 (8 bytes) lefSIT.: Try it here! Code points [108, 101, 102, 83, 73, 84, 46, 58]. Another shorter solution, <...
Mr. Xcoder's user avatar
  • 42.4k
7 votes

Count /[^a-z]/ig with /[a-z]/ig

Pyth, Score 0, 14 11 bytes lfqZhxGrTZQ Try it online! G is the lowercase alphabet in Pyth. There's no built-in for the ...
math junkie's user avatar
  • 7,237
7 votes

Count /[^a-z]/ig with /[a-z]/ig

R, score 9, 38 bytes function(x)sum(!tolower(x)%in%letters) Try it online! Takes input as a vector of characters. R, score 14, 85 bytes ...
pajonk's user avatar
  • 16.7k
7 votes

Count /[^a-z]/ig with /[a-z]/ig

Burlesque, Score 0, 9 bytes qrdfnsait Try it online! ...
DeathIncarnate's user avatar
7 votes

Longest alternating subsequence

Python 3, score 16, \$6.6 \times 10^{2073} \$ bytes exec(b"".fromhex(str(len(" ")))) Try it online! The string ...
xnor's user avatar
  • 145k
7 votes

Count the shared substrings with 2 programs

05AB1E, score 0 (15 bytes) Program 1 (3 bytes): ΢O Try it online or verify all test cases. Program 2 (12 bytes): ...
Kevin Cruijssen's user avatar
6 votes

Count spelling errors in text; minimize the number of spelling errors in your code

Perl 6, 134 spelling errors ...
smls's user avatar
  • 4,450
6 votes

Unique is Cheap

Haskell, score 52 51 f(a:b)=1+sum[1|c<-b,c==a]+f b;f _=0 There's a tab between f and _....
nimi's user avatar
  • 35.9k
6 votes

Find the biggest chunk

BQN, score 1, 125 112 108 bytesSBCS { ⌈ ´ + ˝ ∨ ˝ ∘ × ⎉ 1 ‿ ∞ ˜ ⍟ ≠ 2 > + ´ ∘ | ∘ - ⌜ ˜ ' ' ( + ´ ∘ = ∾ ⊐ ˜ ) ¨ ( ' ' < ⊑ ) ¨ ⊸ / ⌽ ¨ 1 ↓ ↑ 𝕩 } Run online! ...
ovs's user avatar
  • 59.5k
6 votes

Count /[^a-z]/ig with /[a-z]/ig

Haskell, score 6, 81 bytes length.filter(flip notElem"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") Try it online! The non-alphabetic characters ...
Wheat Wizard's user avatar
  • 98.8k
6 votes

Count /[^a-z]/ig with /[a-z]/ig

Java, score: 14 (46 bytes) s->s.filter(c->!Character.isLetter(c)).count() Input as a Character-stream. Doesn't work if the input contains non-ASCII letters (...
Kevin Cruijssen's user avatar
6 votes

Count /[^a-z]/ig with /[a-z]/ig

Factor, score 5 (82 bytes) readln "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"without length pprint Try it online! For once I can get a better ...
chunes's user avatar
  • 24.7k
6 votes

Count /[^a-z]/ig with /[a-z]/ig

JavaScript (in Browser), Score 4, 120 bytes eval(atob`ZXZhbCgicyAgPSIrICAiPnMubWEiKyAidGNoKCIrICIvWyIrICAiXmEtekEtWiIrICJdLyIrImcpPyIrICIubCIrImVuZyIrInRoIHwgMCIp`) ...
tsh's user avatar
  • 34.9k
6 votes

Count /[^a-z]/ig with /[a-z]/ig

CJam, score 0, 95 89 82 bytes qeuWcibWcibKAbFbAbHbAbIbfbXfbKBbKbAbDbAbKbfbKYbKbYbCbfbXdfmdUfmOGYbCbfbUfbXfbUfbXb Try it. Explanations ...
jimmy23013's user avatar
6 votes

Count the shared substrings with 2 programs

Jelly, 14 bytes, score 0 6 bytes ẆċⱮẆ}S Try it online! 8 bytes ⁼þŒD§RF§ Try it online! How? ...
Jonathan Allan's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible