34 votes

Solve Grid-Tangram

BBC BASIC, 570 514 490 bytes ASCII Download interpreter at http://www.bbcbasic.co.uk/bbcwin/download.html 435 bytes tokenised Full program displays an input from ...
user avatar
22 votes
Accepted

Dennis, Doorknob, Martin Büttner, Chris Jester-Young - Pizzeria!

CJam, 20 bytes q~1$*4/"CEDM"e*/:$N* I think this should work :) Try it online Explanation: This first makes a pizza labeled CC…EE…DD…MM… from left to right ...
user avatar
13 votes

Enumerate rhyme schemes

Python 2, 153 ...
user avatar
  • 30.9k
13 votes

Generate all Sublist Partitions

Retina, 27 19 bytes Byte count assumes ISO 8859-1 encoding. +1%`, ;$'¶$`];[ ; , Try it online! Explanation Of course this computes all partitions using string ...
user avatar
13 votes

Partition a square grid into parts of equal area

JavaScript (ES7), 166 bytes Outputs a matrix of integers that describe the partition, or \$false\$ if there's no solution. ...
user avatar
  • 169k
12 votes

Partial factorisations of a positive integer

Haskell, 56 bytes _!1=[[]] i!n=[j:f|j<-[i..n],mod n j<1,f<-j!div n j] (2!) (2!)(1338557220::Int) prints in five ...
user avatar
12 votes

Count occurences of a set in a list

Python, 30 bytes lambda s,l:min(map(l.count,s)) Try it online!
user avatar
  • 55k
11 votes

Enumerate rhyme schemes

Haskell (GHC 7.10), 150 bytes ...
user avatar
11 votes

Third Stirling numbers of the second kind

Jelly, 6 bytes 3Ḋ*)SI Try it online! -1 byte thanks to Jonathan Allan 1-indexed sequence without leading zeros. Uses the formula \$\sum_{k=1}^{n} 3^k - 2^k\$. ...
user avatar
  • 5,808
10 votes
Accepted

Sorted Lexical Partition of a Number

Pyth, 34 FNyUz#aYmv:zhdedC,+0N+NlzB)efqSTTY Try it online here. Notice, this has a time (and space) complexity of O(n). Therefore the test case ...
user avatar
  • 21.8k
10 votes

Generate all Sublist Partitions

Pure Bash, 28 eval echo [${1//:/{:,]:[\}}] Here, lists are colon-separated, and contained in square brackets. For example in the question, the input list would ...
user avatar
10 votes
Accepted

Counting the number of restricted forests on the Möbius ladder of length n

CJam (58 56 chars) Some characters unprintable, and one is a tab which will be mangled by the StackExchange software: ...
user avatar
  • 42.8k
9 votes
Accepted

Maximum Concatenated Product

CJam, 32 28 23 12 bytes 0le!f{~*}:e> Try it online in the CJam interpreter. Thanks to @user23013 for helping me save 16 whole bytes! Idea Permuting the ...
user avatar
  • 207k
9 votes

Refined Partitions

Pyth, 19 bytes &gF_m{.u+NYdYQqFsMQ Try it online: Demonstration or Test harness I'm using Pyth's tuple/list format as input. Simply replace the spaces of ...
user avatar
  • 21.8k
9 votes

Split a number in every possible way

Brachylog, 8 bytes ṫ{~cịᵐ}ᵘ Convert to string and get all unique {…}ᵘ reverse ...
user avatar
  • 11k
8 votes

Dennis, Doorknob, Martin Büttner, Chris Jester-Young - Pizzeria!

Pyth, 30 25 bytes jb.eu_GkbceQs*R/*FQ4"EDMC Live demo and all test cases. Cut off 5 bytes thanks to @Jakube! Same algorithm as my K answer...but a lot shorter....
user avatar
8 votes

Finding sum-free partitions

Python 3, sort by greatest number, n = 92 121 Thanks to Martin Büttner for a suggestion that unexpectedly improved the maximum n reached. Last output: ...
user avatar
8 votes

Interquartile Mean

Pyth, 11 10 bytes .O><lQS*4Ql .OsPtc4S*4 Test suite. How it works It quadruplicates the input list to ensure that the data count is divisible by 4. It still needs sorting, because ...
user avatar
  • 48.6k
8 votes

Interquartile Mean

MATL, 12 11 bytes 4Y"G"6L)]Ym Input is a horizontal vector, with the format [1, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 38] or ...
user avatar
  • 100k
8 votes

Split a list into sized chunks, but not counting items failing predicate

Brachylog, 37 bytes hW&t~c.k{↰₂ˢl}ᵐ;WxĖ∧.bhᵐ↰₂ᵐ∧.t↰₂ˢl≤W∧ Try it online! I was pleasantly surprised to find that this - pretty much a restatement of the ...
user avatar
  • 6,442
8 votes

Split a list into sized chunks, but not counting items failing predicate

Apl (Dyalog Unicode) 17 16 bytes (SBCS) Thanks to Adám for saving me 1 byte. w⊆⍨⌈⎕÷⍨1⌈+\⎕¨w←⎕ Try it online! for explaination purposes I will leave up the 17 byte ...
user avatar
  • 791
8 votes

Split a number in every possible way

05AB1E, 4 bytes .œïÙ Try it online! Explanation ...
user avatar
  • 3,981
8 votes

Is it a vampire number?

Husk, 18 17 14 13 12 bytes Edit: -3 bytes, and then another -1 byte, thanks to Leo, and -1 byte thanks to inspiration from pajonk's R answer (3rd edit) €¹mΠ†dm½f→Pd ...
user avatar
8 votes

Third Stirling numbers of the second kind

R, 23 bytes 3^(n=scan()+2)/2-2^n+.5 Try it online! Outputs without the leading zeros, 0-indexed. Uses formula from OEIS page: $$ a(n) = 9 \cdot 3^n/2 - 4 \cdot 2^...
user avatar
  • 12.1k
8 votes

Third Stirling numbers of the second kind

Jelly, 7 bytes cþæ*2FS Try it online! Now that xigoi has outgolfed me, I thought I'd share my answer. This outputs the \$n\$ term of the sequence without leading ...
user avatar
8 votes

There's more than one way to skin a set

BQN, 15 bytesSBCS (1=⊒)⊸/·⥊(∾∾+)˝ Run online! BQN, 19 bytesSBCS (1=⊒)⊸/<+´∘ר⟜⥊⟜↕2¨ Run online! ...
user avatar
  • 55k
8 votes

Divisible subset sums

JavaScript (ES6), 40 bytes Expects (k)(n). k=>g=(n,s=0)=>n--?g(n,s)+g(n,s-~n):s%k<1 Try it online! Commented ...
user avatar
  • 169k
8 votes

Divisible subset sums

Python 3, 54 bytes f=lambda n,k,r=0:n and f(n-1,k,r)+f(n-1,k,r-n)or r%k<1 Try it online!
user avatar
  • 16.3k
7 votes

Refined Partitions

JavaScript (ES6), 67 70 Edit 3 bytes saved thx @apsillers Run the snippet below in Firefox to test ...
user avatar
  • 31.8k
7 votes
Accepted

Compute the Join and Meet of Partitions

CJam, 32 - 10 = 22 q_~{_{T&},:U-U:+a+}fTp~m*::&La-p ::& is newer than this question. CJam, 36 - 10 = 26 ...
user avatar
  • 36.1k

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