CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 22:35:20 GMT
content-type: text/html; charset=utf-8
cf-ray: 965f9bfbbee4c1b8-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=b0a748ff-0592-427e-a878-6b85ab9dc9e9; expires=Mon, 27 Jul 2026 22:35:20 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: 3ff7708b-aecc-438c-a1f3-8a724e81f71e
x-worker-origin-response-time: 378000000
x-dns-prefetch-control: off
set-cookie: prov=b0a748ff-0592-427e-a878-6b85ab9dc9e9; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=GSusretYii_Y.EitcHPA2Bx8z9L9XzpHDOpYnDFpbl4-1753655720-1.0.1.1-rc7q0.zijjey8GPAjEkBGA1jn2nIsLr6ZV_8zhEbfOqsLRuYMtFeyWmeZG_vnB0cmTW8OqRsr76RQoErbkFOMV0o_oW.Z8JB1bwNWsqzcak; path=/; expires=Sun, 27-Jul-25 23:05:20 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=SOXviQhupm8VsRZYG36_RzLxh9XLdPcuXf_hNqTDjD8-1753655720663-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'set-partitions' Questions - Code Golf Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [set-partitions]
For challenges related to the subdivision of a set into smaller disjoint sets. This also includes the subdivision of ordered collections like lists, and non-discrete sets like intervals. Challenges should carefully define the partition concept being used.
64 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
23
votes
10
answers
2k
views
Half Price for Every Second Pizza
PizzaTata is a popular restaurant specializing in pizza delivery. Customers can order pizzas by phone. And each order is charged by the sum of pizza prices and the delivery fee.
Pizza Prices: The ...
7
votes
8
answers
945
views
Solve the "word break problem" in a single line of code
Challenge
Solve this problem in the fewest number of bytes of code possible.
Write code that takes a string \$str\$ and a dictionary-list of words \$d\$ and finds all combinations of words from \$d\$ ...
11
votes
8
answers
1k
views
Night hike partitioning
We want to go on a night hike with the youth group, but of course not everyone has their torch, even though we told them we planned to split up. What options are there for group formation if n teens ...
16
votes
19
answers
2k
views
Find the fairest partition of a list
Given a list of positive integers, partition the list into two sublists such that the absolute value of the difference of the sums over the two sublists is minimal.
The output of the program should be ...
6
votes
7
answers
3k
views
Help, I can't bloody well memorize this number!
The Brits aren't exactly known for being good at memorizing stuff. That's why scientists need newspaper articles to find those who are, and that's why it shouldn't be a surprise that they forget more ...
22
votes
8
answers
2k
views
Write a set as a union of ranges
In this challenge, we define a range similarly to Python's range function: A list of positive integers with equal differences between them. For example, ...
8
votes
6
answers
273
views
Minimum partition with non-empty intersections
Given a set of intervals \$\mathcal{I} = \{I_1, \ldots, I_m\}\$, where each interval \$I_j\$ is represented by its bounds \$(a_j, b_j)\$, find a partition \$\mathcal{T}\$ of \$\mathcal{I}\$ of minimal ...
19
votes
9
answers
1k
views
Is this substring list ambiguous?
Given a set of substrings, such as [ca, ar, car, rd], it's possible to create infinitely many strings by concatting them together. Some examples of this for the ...
7
votes
9
answers
379
views
Incomparable partitions
A partition of a list \$A\$ is a way of splitting \$A\$ up into smaller parts, concretely it is list of lists that when concatenated gives back \$A\$.
For example ...
21
votes
20
answers
2k
views
Cut along the lines
In this challenge you will take as input a non-empty list of binary values (these can be booleans or integers on the range 0-1), you should output all the ways to partition the list into non-empty ...
16
votes
16
answers
1k
views
Divisible subset sums
Inspired by the recent 3Blue1Brown video
Consider, for some positive integer \$n\$, the set \$\{1, 2, ..., n\}\$ and its subsets. For example, for \$n = 3\$, we have
$$\emptyset, \{1\}, \{2\}, \{3\}, \...
15
votes
28
answers
2k
views
There's more than one way to skin a set
Given a set of positive integers \$ S \$, output the set of all positive integers \$ n \$ such that \$ n \$ can be made by summing a subset of \$ S \$ in more than one different way, i.e., that are ...
12
votes
24
answers
2k
views
Third Stirling numbers of the second kind
\$\left\{ n \atop k \right\}\$ or \$S(n, k)\$ is a way of referring to the Stirling numbers of the second kind, the number of ways to partition a set of \$n\$ items into \$k\$ non-empty subsets. For ...
16
votes
17
answers
881
views
Square chunk my matrix
Your challenge is to write a function/program that takes a matrix of integers m and a number n as input and:
Splits m into n by n chunks
Replaces each chunk with the most common value in that chunk (...
6
votes
1
answer
314
views
The number of tilings of a grid
Setup:
A block is any rectangular array of squares, specified by its dimensions \$(w,h)\$. A grid is any finite ordered list of blocks. For example, \$\lambda = ((3,2),(3,1),(1,2))\$ defines a grid.
...
Welcome to Code Golf and Coding Challenges Stack Exchange! This is a site for recreational programming competitions, not general programming questions. Challenges must have an objective scoring criterion, and it is highly recommended to first post proposed challenges in the Sandbox.
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
code-golf × 62
combinatorics × 17
math × 8
number × 7
grid × 7
array × 6
sequence × 6
decision-problem × 5
string × 5
number-theory × 4
geometry × 4
arithmetic × 3
subsequence × 3
primes × 2
tiling × 2
statistics × 2
restricted-time × 1
topology × 1
graph-theory × 1
matrix × 1
palindrome × 1
optimized-output × 1
more related tags
Hot Network Questions
- Class for validating code in different Conda environments with PyTorch
- Blinded despite Blindsight?
- Are you required to protect trade secrets revealed to you even if you didn't sign an NDA?
- I don't have enough alive employees to start the day. What now?
- Forces applied to a car hood while driving
- Which prophecies was Jesus referring to in Luke 18:31?
- How to deter wasps from an untreated larch fence
- How can I turn the text in a PNG file back into text layer?
- Why is 0.0 printed as 0.00001 when rounding upward?
- Lower bound on ratio of expected maxima of i.i.d. samples from distribution on [0,1]
- Time Machine backup disk not writeable any longer
- I struggle to draft without editing
- Why does Timor-Leste call itself a "Democratic Republic" despite little apparent Marxist-Leninist ideology?
- A word with five hundred of a single alphabet? That must be a myth.
- How do Japanese people understand the reading of a single kanji with multiple readings in their everyday life?
- Why is time reversal not a natural part of the Galilean group?
- Heretofore I think I have been using 'heretofore' incorrectly
- Shared-Memory Queue Implementation in C
- If I buy spell components for a different price than the official one, does that change anything about how they work as a component?
- \markup vertical spacing and order
- About the translation of Matthew 19:17
- “Unclear step in a math book for entertainment”
- Will an error in two of my published papers affect my PhD thesis evaluation?
- Book recommendations for theistic books about God's existence