This "sandbox" is a place where Code Golf users can get feedback on prospective challenges they wish to post to main. This is useful because writing a clear and fully specified challenge on your first try can be difficult, and there is a much better chance of your challenge being well received if you post it in the sandbox first.

Sandbox FAQ


To post to the sandbox, scroll to the bottom of this page and click "Answer This Question". Click "OK" when it asks if you really want to add another answer.

Write your challenge just as you would when actually posting it, though you can optionally add a title at the top. You may also add some notes about specific things you would like to clarify before posting it. Other users will help you improve your challenge by rating and discussing it.

When you think your challenge is ready for the public, go ahead and post it, and replace the post here with a link to the challenge and delete the sandbox post.


The purpose of the sandbox is to give and receive feedback on posts. If you want to, feel free to give feedback to any posts you see here. Important things to comment about can include:

  • Parts of the challenge you found unclear
  • Comments addressing specific points mentioned in the proposal
  • Problems that could make the challenge uninteresting or unfit for the site

You don't need any qualifications to review sandbox posts. The target audience of most of these challenges is code golfers like you, so anything you find unclear will probably be unclear to others.

If you think one of your posts requires more feedback, but it's been ignored, you can ask for feedback in The Nineteenth Byte. It's not only allowed, but highly recommended! Be patient and try not to nag people though, you might have to ask multiple times.

It is recommended to leave your posts in the sandbox for at least several days, and until it receives upvotes and any feedback has been addressed.


Search the sandbox / Browse your pending proposals

The sandbox works best if you sort posts by active.

To add an inline tag to a proposal, use shortcut link syntax with a prefix: [tag:king-of-the-hill]. To search for posts with a certain tag, include the name in quotes: "king-of-the-hill".

  • \$\begingroup\$ What if I posted on the sandbox a long time ago and get no response? \$\endgroup\$
    – None1
    Commented May 15 at 14:05
  • \$\begingroup\$ @None1 If you don't get feedback for a while you can ask in the nineteenth byte \$\endgroup\$
    – mousetail
    Commented May 29 at 13:27

4703 Answers 4703

139 140
142 143

Draw minimalistic southpark characters

Your task is to output or draw this image of our favorite characters. It is obviously inspired from the logo of Southpark Digital Studios, as shown here: https://southpark.cc.com/, but simplified.


The image has an aspect ratio of 40:12, and everything is aligned on this 40x12 grid. You must output a bitmap image of at least 40 by 12 pixels or a vector graphic.

I've enlarged this images and added thin gray lines for easy pixel counting. The background should be black, white or transparent.

enlarged version

You must use at least 12 bit color depth (4 bit per RGB channel) and these colors:

Stan:    #56a #fdb #a65
Kyle:    #f61 #fdb #3a3
Cartman: #4bc #fdb #d24
Kenny:   #f61 #743 #fdb (outer - middle - inner)

Open questions:

I want a transparent background, which is meaningless (or very difficult) if the image is show on screen.


Which skill to train?


One-dimensional map colouring


Night hike partitioning


The Challenge Challenge

Your goal is to create a challenge that has the longest possible best solution. Post it as an answer to this question, along with the shortest possible solution to that challenge you know of. The number of bytes in that solution is your score, with a higher score being better. To prevent challenges that are boring, bad, not in the spirit of the contest, made of many arbitrary steps, etc, the answer with the most votes will win.


  • You may not include special scoring in your challenge. All that matters is byte-count.
  • You may not intentionally limit the number of languages that can participate in your challenge; any language that can output and input text should be a language that your challenge could be completed in.
  • If someone finds a shorter solution to your challenge, you must update your answer with that solution once you see it.
  • Your challenge must not need links to be complete; you can't refer to a website for parts of your challenge other than to clarify. This is to prevent challenges that are too complex, with many arbitrary steps. Your solution to your challenge is not included in this rule.
  • You may not create a challenge where the goal is simply to output a piece of text ( challenges are not allowed). For example, the factorial/negation challenge is allowed, but outputting an ASCII keyboard is not.

Requirements for an answer

  • A challenge (within the answer)
  • The shortest possible solution to it (that you know of), or, if it is too long to fit, a sufficient explanation of what it that so that the program could be constructed without any difficulty.
  • The length of that solution

If someone finds an answer to your challenge with a byte count that is shorter than your answer to your challenge, that becomes your new byte count.

The challenge with the most votes wins.


  • Looking at meta pop con questions, I think this satisfies what is needed for one of those. Are there changes I need to make here though?
  • Are there any ways I should change this in general?
  • Are there comments I haven't fully addressed?
  • \$\begingroup\$ Would a user post a new challenge as a question, then link to it in an answer to your challenge? \$\endgroup\$
    – Someone
    Commented Dec 14, 2023 at 18:26
  • 1
    \$\begingroup\$ @Somebody I think the idea was that each answer to this challenge would contain both a spec and a solution. \$\endgroup\$ Commented Dec 14, 2023 at 19:06
  • 4
    \$\begingroup\$ This is a cool idea, but I think it’s likely that submissions will devolve to “output the following text” with a solution that uses a built-in compression method. \$\endgroup\$ Commented Dec 14, 2023 at 19:10
  • \$\begingroup\$ @noodleman You are right on both points. I was going to add a rule that stopped people from doing the “output the following text” thing, but forgot when I wrote it up, so I'll add that now. \$\endgroup\$
    – Jakav
    Commented Dec 14, 2023 at 21:41
  • \$\begingroup\$ I've made changes to the question. Is this ready to post, or are additional changes needed? \$\endgroup\$
    – Jakav
    Commented Dec 14, 2023 at 22:08
  • 1
    \$\begingroup\$ The exception you added doesn't make sense, because the linked Fizz Buzz challenge is a kolmogorov-complexity challenge. \$\endgroup\$
    – m90
    Commented Dec 15, 2023 at 6:50
  • 2
    \$\begingroup\$ -1, I don't think there is a way to make this challenge interesting - there are too many possible challenges. For example, if someone just makes up a random composition of actions, it's quite likely there isn't a much shorter program for that. How do you even exclude something like \$f(n) = \text{some random number} \cdot n\$, and the myriad of other equivalents? \$\endgroup\$ Commented Dec 15, 2023 at 10:11
  • \$\begingroup\$ @m90 Thanks, I'll change that. \$\endgroup\$
    – Jakav
    Commented Dec 15, 2023 at 13:58
  • \$\begingroup\$ @CommandMaster The only way I see is to make it a popularity contest. If it isn't, I can't exclude those things. I'm not sure what changes would be needed to make it a popularity contest though, if it even is possible. \$\endgroup\$
    – Jakav
    Commented Dec 16, 2023 at 14:24

Translate Japanese hiragana into the flick input method


Output [Some-Text]. You're given its translate in [Some-Language].

Sandbox Notes:

  • This seems area where machine learning would work
  • Stealing question Allowed

golf a range with modulus and subtraction


Output a 1-digit integer log table

Log tables were originally used for multiplication, since \$ x \times y = \exp(\log x + \log y) \$, superseding the use of trigonometric functions for this purpose. A log table I used in school back in the day had 900 main entries and then some interpolation entries you could use to give yourself almost an extra digit of accuracy.

However, if you were building a mechanical computer, you wouldn't need to have thousands of entries, as you could just program it to do long multiplication; the stumbling block is actually multiplying two digits together in the first place.

One approach to this is to use something called an Irish logarithm table. This is basically a pair of integer mappings \$ f \$ and \$ g \$ such that \$ g(f(x) + f(y)) = x \times y \$ for all \$ x, y \in \{ 0..9 \} \$.

For this challenge I would like you to output any two integer mappings with that property, in any reasonable format. In particular, since the length of the f mapping is always ten, there is no need to separate the f and g mappings in your output.

Note that while the f mapping maps from 0 to 9, the g mapping will have gaps because some of its indices won't correspond to the sum of two values of f. You can handle this either by outputting the mapping as a dictionary or by padding the output array with a suitable filler value.

Excluding the filler value, the g mapping only needs to output the values 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, 28, 30, 32, 35, 36, 40, 42, 45, 48, 49, 54, 56, 63, 64, 72, 81.

This is , so the shortest program or function that breaks no standard loopholes wins!

  • \$\begingroup\$ Any potentially shorter way than log(x)*999? \$\endgroup\$
    – l4m2
    Commented Dec 31, 2023 at 0:41
  • \$\begingroup\$ @l4m2 What integer are you using for an input of 0? \$\endgroup\$
    – Neil
    Commented Dec 31, 2023 at 0:59
  • \$\begingroup\$ Also, I can see I should have specified non-negative integers. \$\endgroup\$
    – Neil
    Commented Dec 31, 2023 at 1:03
  • \$\begingroup\$ And I might need to include the highest index of g in the scoring somehow. \$\endgroup\$
    – Neil
    Commented Dec 31, 2023 at 1:04
  • \$\begingroup\$ Is there a reason for outputting mappings and not just implementing the functions? \$\endgroup\$ Commented Dec 31, 2023 at 4:30
  • \$\begingroup\$ @CommandMaster It's to help you construct a mechanical calculator which can do lookup tables but not function calls. \$\endgroup\$
    – Neil
    Commented Dec 31, 2023 at 8:18
  • \$\begingroup\$ I just don't think that requiring answers to do return [f(i) for i in range(10)] is interesting - do you have solutions constructing these mappings in a different way? \$\endgroup\$ Commented Dec 31, 2023 at 9:12
  • \$\begingroup\$ @CommandMaster I wasn't expecting there to be a closed form for f and g; if you have one then this question becomes irrelevant. \$\endgroup\$
    – Neil
    Commented Dec 31, 2023 at 9:41
  • \$\begingroup\$ There is discrete log mod 83, although that isn't really a closed form and you need to do something for 0 \$\endgroup\$ Commented Dec 31, 2023 at 10:11

Golf golfing a range with modulus and subtraction

In this other question I asked you to golf code which finds an equation transforming a list of unique numbers down to a minimal list. For this question, I'm asking you to write code which golfs that equation. In the other question we found that ((l-5)%99-94)%98 is a valid equation that turns l=[2,1,5,3,99,7,6] into [2,1,4,3,0,6,5], but if we do some more thinking, we can see that there are shorter ways to do this: (l%91-5)%8 gives the list [5,4,0,6,3,2,1] and l%95-1 gives the list [1,0,4,2,3,6,5]. Rather than golfing the code used to generate the equation, in this question you are looking for an algorithm that produces the shortest final equation.

To be a valid answer, your code must give an equation that transforms a provided list of unique, non-negative integers into a list of unique, non-negative integers in the range 0 to len(list)-1. You are scored for the length of the equation that you output rather than the length of your code. Each operation is one point, so an output of ((l-5)%99-94)%98 would score 4, (l%91-5)%8 would score 3, and l%95-1 would score 2. In a tie, the score is the character length of the complete equation including parenthesis, so ((l-5)%99-94)%98 would score 16, (l%91-5)%8 would score 10, and l%95-1 would score 6. Lowest score wins, as with normal code golf.

Different lists may give better scores using some algorithms over others, so we need to test your code to be sure that it is the best for many different lists. The score you list on your answer is the average score your code gets on all lists of 1-15 digits with values in the range 0-63 (say the average primary and secondary score in your answer). As this question is about the algorithm rather than the code length, you should explain your method as well. If you can prove that your method will always give the best possible score, I will mark your answer as accepted and (if it's simple enough) use your method as the example explanation in the other question. If this happens, I will also edit this question to include an explanation of your algorithm and this question will become a normal code-golf question where everyone implements that algorithm or an equivalent in as few bytes as possible in each language.

As the lists your code is tested against are finite in length and have a maximum value, you could theoretically brute-force the shortest solution by trying every possible modulus and subtraction value and returning the shortest. To prevent this, your code should run in less than O(r^l) time, where r is the range and l is the length.

@sandbox, What do you think is a good range? Should it be 1-7 digits, 1-31 digits? Values from 0-31, values from 0-127? Or should it be decimal ranges, 1-9 digits ranging from 0-99?

Also, what other tags?

  • \$\begingroup\$ Is there anything preventing solutions from doing a boring, trivially optimal, bruteforce solution? \$\endgroup\$ Commented Dec 23, 2023 at 2:48
  • \$\begingroup\$ @CommandMaster do you think that looks good for preventing bruteforce solutions? \$\endgroup\$
    – guest4308
    Commented Dec 24, 2023 at 4:33
  • 1
    \$\begingroup\$ Requiring to build the equation one operand at a time seems overly restrictive, and it's also not very clearly defined. What kind of calculations can you do on the array, before you actually "build" the solution? \$\endgroup\$ Commented Dec 24, 2023 at 4:56
  • \$\begingroup\$ @CommandMaster yeah, I think that worked better in my head than it would in practice. I can't think of any other way to restrict bruteforce solutions without also restricting algorithmic solutions, do you have any ideas? or if not; is it fine to just have 'the brute force solution does not count' in the question? \$\endgroup\$
    – guest4308
    Commented Dec 24, 2023 at 5:03
  • \$\begingroup\$ I think the best way to prevent brute force would just be to restrict the runtime, and have larger inputs \$\endgroup\$ Commented Dec 24, 2023 at 5:04
  • \$\begingroup\$ @CommandMaster do you think that works to prevent bruteforce? and also for larger inputs what were you thinking would be a good amount? I think rn it's checking around 2e14 lists \$\endgroup\$
    – guest4308
    Commented Dec 26, 2023 at 14:59

Unnecessary fluff

Sandbox note

There is a fairly efficient way to calculate this \$h\$, which might be interesting. Do you think I should require polynomial time, or being able to calculate all the testcases in a minute?


Shortest path to open a letter lock

  • \$\begingroup\$ I think this is easier than you intend it to be, but fair enough. Can the input be taken as a list of indices of the alphabet rather than a string / list of codepoints? \$\endgroup\$ Commented Jan 6 at 22:45
  • \$\begingroup\$ @noodleman i think that would ruin the theme here, i wasnt even sure if i should include the list of letters instead of the full string \$\endgroup\$
    – pacman256
    Commented Jan 7 at 0:06
  • 1
    \$\begingroup\$ Well, taking a string as a list of characters is an I/O default on this site. I would personally recommend letting letters of the alphabet be taken as indices, as that's just an extra step that most solutions will have to use and could be very long in some languages. Alternatively, a slightly more interesting variant of this challenge would be to take an arrangement of the alphabet as input (like abc...z or azbycx... or ajoifqw...) rather than always using the same alphabet. \$\endgroup\$ Commented Jan 7 at 1:34
  • \$\begingroup\$ @noodleman From what I have seen, allowing letters to be replaced with indices is generally not an option for input in challenges like this, especially when the whole point is to have two "words" to switch between \$\endgroup\$
    – pacman256
    Commented Jan 7 at 4:55

Circle to split points

Given two sets of points, decide whether there's a circle that split them.

  • Treating points exactly on circle as inside or outside are allowed as radius +/-eps

  • Maybe one input forced inside and one outside?


The Elements Of The Periodic Table!

The challenge is to take input as an integer between 1 and 118 inclusive, then output the name of the chemical element with that atomic number.

Capitalisation as well as trailing and leading whitespace do not matter.

You should call the chemical elements by their 2024 names, for example 113 outputs nihonium and not ununtrium.

For ease of golfing, element 16 can be either sulfur or sulphur.

Test cases:

1 -> hydrogen
2 -> helium
3 -> lithium
4 -> beryllium
5 -> boron
6 -> carbon
117 -> tennessine
118 -> oganesson

Use any language, shortest code in bytes wins.


Find the child anagrams of a word


Battle Simulator KOTH


In this king-of-the-hill challenge, each player/bot is assigned a random character and is then put in a 10x10 grid. Each character has 2 different abilities and 1 ultimate ability. The goal of each player is to be the last man standing.


At the start of each game, each bot is given 10 health and 10 points to freely distribute through these 3 categories:

Speed (for example if you have three speed you can go up 2 and left 1 in one turn)

Dexterity (the more dexterity you have the less chance you have of getting hit by an attack. For example if you have 3 dexterity and was attacked by an attack that does 4 damage, there is a 3 * 3 = 9% chance you dodge it where the second 3 is a constant.)

Defense (let's say you have 3 defense and was hit by an attack that does 5 damage. Then you will take a random amount of damage from 1 to 1 where the second 1 is attack strength - defense / 2)

Each bot is also randomly assigned one of these two characters:


  • Normal ability (Stab):
    • 0 (turns of) recharge
    • does 1 damage
    • hits the three tiles in front of him
  • Special ability 1 (Circle Slash):
    • 2 recharge
    • does 2 damage
    • hits the 9 tiles surrounding him
  • Special ability 2 (Multi-Sword):
    • 4 recharge
    • does 2 damage
    • hits the three closest enemies
  • Ultimate Ability (Explosion):
    • 10 recharge (cannot be used at beginning of game)
    • does 6 damage
    • hits the first player in front of him and triggers a 6x6 explosion


  • Normal ability (Burn):
    • 0 recharge
    • does 2 damage
    • hits the tile directly in front of him
  • Special ability 1 (Freeze):
    • 3 recharge
    • does 1 damage
    • freezes the first enemy in front of him for 2 turns
  • Special ability 2 (Zap):
    • 5 recharge
    • does 2 damage
    • zaps the five closest enemies, twice
  • Ultimate ability (Weaken):
    • 15 recharge (cannot be used at the beginning of game)
    • 0 damage
    • halves all stats of all other players (can stack)

However, there is a twist. Each bot does NOT know what character type they are.


Each turn, every player does one of the following:

  • Do nothing (lol)
  • Use an attack that is not on cooldown (attacks can miss)
  • Move

When a player is hit by an attack, their health goes down by how strong the attack is and is also hit by status effects should the attack have them. If a player's health reaches zero, they are defeated (e. g. removed from the game) and are replaced by a rock other players may not pass through. If a player tries to move through a rock or another player, they simply end up in front of it and do not go through.

The game ends in 100 turns or only one player remains, whichever comes first. If the game lasts that long, the winner is the one with most eliminations. If there still is a tie, all tied bots receive a point for that round. Of course, if only one player remains before the 100 turns, that player wins the round and gets a point.

How bots work

Bots should be written in Python, but I will try to support other mainline languages by translating them into Python.

The basic boilerplate code for a bot is this:

class MyBotThatWillHopefullyWin(Bot):
    def __init(self)__:
        super().__init__(self, <speed>, <dexterity>, <defense>)
    def turn():
        <insert logic>

The turn function is basically your main function and will be executed for every turn your bot is alive for. It should return one of four values:

  • return "move", <x>, <y> to move (duh.) Or in more specific terms, Tuple[Union[str, Union[int, int]]] where str must be move and abs(x + y) must be <= self.speed (the first value you put in the super definition.) If this condition is not satisfied, nothing happens that turn. Note how you cannot leave the confines of the 10x10 grid or move and attack or vice versa in the same turn.

  • return "basic attack" to do the (randomly predetermined) charector's basic attack.

  • return "ability", <ability number> to do one of the charector's abilities. 1 is the charector's first special ability, 2 is the second, and 3 is the ultimate ability. If the ability numberis not in the range 1-3 or the attack is still on cooldown, nothing happens.

  • return "nothing" to do nothing. But why tho?

Here is the list of methods bots have available to them: (accessed by self.<method name(<parameters, if any>)

  • \$\begingroup\$ What do players know? Only the location of enemies and whether they're dead, and their own health? \$\endgroup\$ Commented Jan 18 at 3:44
  • \$\begingroup\$ @CommandMaster I'll add that in when I have the time. \$\endgroup\$ Commented Jan 18 at 14:56

ahee bee cee dee ehee fee...

Given a string with no whitespace, replace the first letter of the string with every letter in the english lowercase alphabet. However, if the input string starts with a vowel (excluding y), then there should be an extra h after (the prefixes aeiou.)

For example, if the input string is ee, your program should output:

  • \$\begingroup\$ Where do eht come? \$\endgroup\$
    – l4m2
    Commented Jan 22 at 2:35
  • \$\begingroup\$ @I4m2 Should be fixed now. \$\endgroup\$ Commented Jan 22 at 14:28

What are the current football (soccer) league positions?

English football is structured into leagues with varying numbers of clubs. For example, the EFL Championship has 24 clubs. During each season, each side will play every other side twice (once at home and once away); for a 24-club league, this gives 46 matches for each team in total. Teams score three points for a win, one for a draw and none for a loss. The ranking in the league is determined by:

  1. Points gained
  2. Goal difference
  3. Goals scored
  4. Head-to-head record
  5. Alphabetical order (unless the position is relevant for a promotion, relegation or play-off space, but this has never happened, and will not need to be handled for this challenge)



  • A list of games played so far in the league, indicating the home team, away team, score for the home team and score for the away team.

Desired output

  • A list of teams in position order, either highest to lowest or lowest to highest (but must be consistent for all inputs).

Rules and assumptions

  • Teams can be represented in whatever way the answerer prefers. You may take actual team names, integers, or any other standard input provided the team name does not somehow encode its position in the league and none of the default loopholes are violated. Team names in the output should match those in the input.
  • All teams in the league will have played at least once at the time of asking, though they will not necessarily have all played each other by that stage, nor will they have necessarily played the same number of matches. Of note, the interim league tables for English football show the number of matches played, but the relative positioning does not take into account that one team may have matches in hand.
  • You do not need to provide any of the stats typically presented in a football league table, just the ordering of teams.
  • Default loopholes and standard I/O methods apply
  • Although input is flexible, the home/away ordering should be preserved (so it is not valid to require the winning team always be listed first)
  • This is so the shortest code in bytes wins!

Example input

[["Leeds United",2],["Preston North End",1]],
[["Plymouth Argyle",3],["Cardiff City",1]],
[["Middlesbrough",1],["Rotherham United",1]],
[["Norwich City",2],["West Bromwich Albion",0]],
[["Stoke City",1],["Birmingham City",2]],
[["Queens Park Rangers",2],["Millwall",0]],
[["Sheffield Wednesday",1],["Coventry City",2]],
[["Blackburn Rovers",1],["Huddersfield Town",1]],
[["Bristol City",1],["Watford",1]],
[["Swansea City",1],["Southampton",3]],
[["Sunderland",0],["Hull City",1]],
[["Queens Park Rangers",1],["Watford",2]],
[["Ipswich Town",2],["Sunderland",1]],
[["Rotherham United",0],["Stoke City",1]],
[["Southampton",4],["Sheffield Wednesday",0]],
[["West Bromwich Albion",4],["Blackburn Rovers",1]],
[["Huddersfield Town",1],["Plymouth Argyle",1]],
[["Cardiff City",0],["Leeds United",3]],
[["Birmingham City",2],["Swansea City",2]],
[["Preston North End",2],["Bristol City",0]],
[["Coventry City",3],["Leicester City",1]],
[["Hull City",1],["Norwich City",2]],
[["Sheffield Wednesday",3],["Hull City",1]],
[["Norwich City",1],["Southampton",1]],
[["Blackburn Rovers",2],["Rotherham United",2]],
[["Bristol City",0],["Millwall",1]],
[["Leeds United",3],["Birmingham City",0]],
[["Leicester City",4],["Huddersfield Town",1]],
[["Middlesbrough",1],["Coventry City",3]],
[["Plymouth Argyle",3],["Watford",3]],
[["Stoke City",0],["Ipswich Town",0]],
[["Swansea City",1],["West Bromwich Albion",0]],
[["Queens Park Rangers",1],["Cardiff City",2]],
[["Sunderland",2],["Preston North End",0]],
[["West Bromwich Albion",1],["Leeds United",0]],
[["Ipswich Town",0],["Queens Park Rangers",0]],
[["Cardiff City",0],["Leicester City",2]],
[["Coventry City",2],["Swansea City",2]],
[["Huddersfield Town",1],["Middlesbrough",2]],
[["Hull City",3],["Blackburn Rovers",2]],
[["Rotherham United",1],["Sunderland",1]],
[["Millwall",1],["Norwich City",0]],
[["Preston North End",0],["Sheffield Wednesday",1]],
[["Watford",1],["Stoke City",1]],
[["Birmingham City",0],["Bristol City",0]],
[["Southampton",2],["Plymouth Argyle",1]],
[["Ipswich Town",1],["Leicester City",1]],
[["Birmingham City",1],["Stoke City",3]],
[["Rotherham United",1],["Middlesbrough",0]],
[["Southampton",5],["Swansea City",0]],
[["Hull City",0],["Sunderland",1]],
[["Huddersfield Town",3],["Blackburn Rovers",0]],
[["Coventry City",2],["Sheffield Wednesday",0]],
[["Cardiff City",2],["Plymouth Argyle",2]],
[["West Bromwich Albion",1],["Norwich City",0]],
[["Watford",1],["Bristol City",4]],
[["Millwall",2],["Queens Park Rangers",0]],
[["Preston North End",2],["Leeds United",1]],
[["Stoke City",0],["Millwall",0]],
[["Sunderland",0],["Coventry City",3]],
[["Sheffield Wednesday",1],["Cardiff City",2]],
[["Leicester City",3],["Rotherham United",0]],
[["Queens Park Rangers",0],["Southampton",1]],
[["Plymouth Argyle",3],["Birmingham City",3]],
[["Norwich City",2],["Huddersfield Town",0]],
[["Middlesbrough",1],["West Bromwich Albion",0]],
[["Blackburn Rovers",1],["Watford",2]],
[["Leeds United",4],["Ipswich Town",0]],
[["Swansea City",2],["Preston North End",1]],
[["Bristol City",3],["Hull City",2]],
[["Birmingham City",2],["Leicester City",3]],
[["West Bromwich Albion",1],["Stoke City",1]],
[["Plymouth Argyle",3],["Rotherham United",2]],
[["Swansea City",1],["Middlesbrough",2]],
[["Southampton",4],["Blackburn Rovers",0]],
[["Sheffield Wednesday",2],["Queens Park Rangers",1]],
[["Preston North End",1],["Watford",5]],
[["Millwall",1],["Huddersfield Town",1]],
[["Leeds United",1],["Coventry City",1]],
[["Hull City",3],["Cardiff City",0]],
[["Bristol City",1],["Sunderland",0]],
[["Ipswich Town",2],["Norwich City",2]],
[["Middlesbrough",1],["Hull City",2]],
[["Cardiff City",0],["Birmingham City",1]],
[["Coventry City",1],["Southampton",1]],
[["Norwich City",3],["Sheffield Wednesday",1]],
[["Leicester City",3],["Millwall",2]],
[["Queens Park Rangers",0],["Plymouth Argyle",0]],
[["Sunderland",1],["Leeds United",0]],
[["Watford",1],["Ipswich Town",2]],
[["Stoke City",1],["Swansea City",1]],
[["Rotherham United",0],["West Bromwich Albion",2]],
[["Huddersfield Town",1],["Preston North End",3]],
[["Blackburn Rovers",2],["Bristol City",1]],
[["Norwich City",0],["Preston North End",0]],
[["Cardiff City",1],["Millwall",0]],
[["Leicester City",4],["Plymouth Argyle",0]],
[["Middlesbrough",0],["Ipswich Town",2]],
[["Huddersfield Town",1],["Bristol City",1]],
[["Queens Park Rangers",2],["Hull City",0]],
[["Stoke City",0],["Sheffield Wednesday",1]],
[["Rotherham United",1],["Swansea City",2]],
[["Sunderland",2],["West Bromwich Albion",1]],
[["Blackburn Rovers",0],["Leeds United",2]],
[["Coventry City",2],["Birmingham City",0]],
[["Bristol City",1],["Norwich City",2]],
[["Birmingham City",0],["Rotherham United",0]],
[["Hull City",1],["Watford",2]],
[["Ipswich Town",2],["Coventry City",1]],
[["Leeds United",3],["Middlesbrough",2]],
[["Swansea City",1],["Huddersfield Town",1]],
[["Plymouth Argyle",2],["Stoke City",1]],
[["Sheffield Wednesday",3],["Blackburn Rovers",1]],
[["Southampton",2],["Cardiff City",0]],
[["West Bromwich Albion",1],["Leicester City",2]],
[["Preston North End",0],["Queens Park Rangers",2]],
[["Ipswich Town",3],["Millwall",1]],
[["Blackburn Rovers",4],["Birmingham City",2]],
[["Leeds United",3],["Swansea City",1]],
[["Sheffield Wednesday",1],["Leicester City",1]],
[["Southampton",1],["Bristol City",0]],
[["Sunderland",1],["Huddersfield Town",2]],
[["Watford",3],["Norwich City",2]],
[["Queens Park Rangers",4],["Stoke City",2]],
[["Middlesbrough",4],["Preston North End",0]],
[["Hull City",4],["Rotherham United",1]],
[["Coventry City",1],["Plymouth Argyle",0]],
[["Cardiff City",0],["West Bromwich Albion",1]],
[["West Bromwich Albion",2],["Ipswich Town",0]],
[["Millwall",0],["Coventry City",3]],
[["Birmingham City",2],["Sheffield Wednesday",1]],
[["Bristol City",3],["Middlesbrough",2]],
[["Huddersfield Town",1],["Southampton",1]],
[["Leicester City",2],["Watford",0]],
[["Norwich City",1],["Queens Park Rangers",0]],
[["Preston North End",1],["Cardiff City",2]],
[["Stoke City",0],["Blackburn Rovers",3]],
[["Swansea City",2],["Hull City",2]],
[["Plymouth Argyle",2],["Sunderland",0]],
[["Rotherham United",1],["Leeds United",1]],
[["Cardiff City",2],["Norwich City",3]],
[["Leeds United",2],["Plymouth Argyle",1]],
[["Coventry City",0],["Stoke City",0]],
[["Hull City",1],["Huddersfield Town",0]],
[["Ipswich Town",3],["Swansea City",2]],
[["Southampton",2],["West Bromwich Albion",1]],
[["Middlesbrough",1],["Leicester City",0]],
[["Queens Park Rangers",0],["Bristol City",0]],
[["Sheffield Wednesday",0],["Millwall",4]],
[["Watford",5],["Rotherham United",0]],
[["Sunderland",3],["Birmingham City",1]],
[["Blackburn Rovers",1],["Preston North End",2]],
[["Rotherham United",2],["Ipswich Town",2]],
[["Norwich City",1],["Blackburn Rovers",3]],
[["West Bromwich Albion",3],["Hull City",1]],
[["Swansea City",0],["Sunderland",0]],
[["Birmingham City",2],["Ipswich Town",2]],
[["Bristol City",1],["Sheffield Wednesday",0]],
[["Huddersfield Town",0],["Watford",0]],
[["Rotherham United",1],["Queens Park Rangers",1]],
[["Plymouth Argyle",3],["Middlesbrough",3]],
[["Preston North End",3],["Coventry City",2]],
[["Stoke City",0],["Cardiff City",0]],
[["Leicester City",0],["Leeds United",1]],
[["Coventry City",0],["West Bromwich Albion",2]],
[["Sheffield Wednesday",2],["Rotherham United",0]],
[["Ipswich Town",3],["Plymouth Argyle",2]],
[["Blackburn Rovers",0],["Swansea City",1]],
[["Cardiff City",2],["Bristol City",0]],
[["Hull City",1],["Preston North End",0]],
[["Middlesbrough",0],["Stoke City",2]],
[["Queens Park Rangers",1],["Leicester City",2]],
[["Sunderland",3],["Norwich City",1]],
[["Leeds United",4],["Huddersfield Town",1]],
[["Southampton",3],["Birmingham City",1]],
[["Stoke City",1],["Leeds United",0]],
[["Rotherham United",2],["Coventry City",0]],
[["Preston North End",2],["Southampton",2]],
[["Plymouth Argyle",3],["Sheffield Wednesday",0]],
[["Bristol City",0],["Ipswich Town",1]],
[["Birmingham City",0],["Hull City",2]],
[["West Bromwich Albion",2],["Queens Park Rangers",0]],
[["Leicester City",1],["Sunderland",0]],
[["Swansea City",0],["Watford",1]],
[["Norwich City",1],["Middlesbrough",2]],
[["Millwall",1],["Blackburn Rovers",2]],
[["Huddersfield Town",0],["Cardiff City",4]],
[["Middlesbrough",1],["Birmingham City",0]],
[["Blackburn Rovers",1],["Cardiff City",0]],
[["Bristol City",1],["Coventry City",0]],
[["Huddersfield Town",2],["Queens Park Rangers",1]],
[["Hull City",1],["Southampton",2]],
[["West Bromwich Albion",0],["Plymouth Argyle",0]],
[["Norwich City",2],["Leeds United",3]],
[["Stoke City",2],["Sunderland",1]],
[["Swansea City",1],["Leicester City",3]],
[["Watford",1],["Sheffield Wednesday",0]],
[["Preston North End",1],["Millwall",1]],
[["Cardiff City",1],["Watford",1]],
[["Southampton",1],["Rotherham United",1]],
[["Sheffield Wednesday",0],["Huddersfield Town",0]],
[["Queens Park Rangers",0],["Blackburn Rovers",4]],
[["Plymouth Argyle",1],["Swansea City",3]],
[["Millwall",2],["Hull City",2]],
[["Leicester City",2],["Stoke City",0]],
[["Leeds United",2],["Bristol City",1]],
[["Ipswich Town",4],["Preston North End",2]],
[["Coventry City",1],["Norwich City",1]],
[["Birmingham City",3],["West Bromwich Albion",1]],
[["Rotherham United",1],["Bristol City",2]],
[["Leicester City",3],["Preston North End",0]],
[["Leeds United",1],["Queens Park Rangers",0]],
[["Coventry City",1],["Blackburn Rovers",0]],
[["Swansea City",2],["Norwich City",1]],
[["West Bromwich Albion",1],["Sheffield Wednesday",0]],
[["Stoke City",0],["Southampton",1]],
[["Plymouth Argyle",0],["Millwall",2]],
[["Middlesbrough",2],["Cardiff City",0]],
[["Ipswich Town",3],["Hull City",0]],
[["Birmingham City",4],["Huddersfield Town",1]],
[["Blackburn Rovers",1],["Leicester City",4]],
[["Huddersfield Town",1],["Ipswich Town",1]],
[["Millwall",0],["Swansea City",3]],
[["Cardiff City",2],["Rotherham United",0]],
[["Bristol City",2],["Stoke City",3]],
[["Hull City",1],["Plymouth Argyle",1]],
[["Norwich City",2],["Birmingham City",0]],
[["Queens Park Rangers",1],["Coventry City",3]],
[["Preston North End",0],["West Bromwich Albion",4]],
[["Southampton",3],["Leeds United",1]],
[["Sheffield Wednesday",0],["Sunderland",3]],
[["Coventry City",1],["Huddersfield Town",1]],
[["Sunderland",0],["Cardiff City",1]],
[["Stoke City",1],["Hull City",3]],
[["Leeds United",3],["Watford",0]],
[["West Bromwich Albion",0],["Millwall",0]],
[["Swansea City",3],["Sheffield Wednesday",0]],
[["Rotherham United",1],["Preston North End",1]],
[["Plymouth Argyle",6],["Norwich City",2]],
[["Leicester City",1],["Bristol City",0]],
[["Ipswich Town",4],["Blackburn Rovers",3]],
[["Birmingham City",0],["Queens Park Rangers",0]],
[["Norwich City",0],["Leicester City",2]],
[["Watford",2],["West Bromwich Albion",2]],
[["Millwall",3],["Rotherham United",0]],
[["Hull City",0],["Leeds United",0]],
[["Huddersfield Town",2],["Stoke City",2]],
[["Blackburn Rovers",1],["Sunderland",3]],
[["Sheffield Wednesday",1],["Middlesbrough",1]],
[["Bristol City",4],["Plymouth Argyle",1]],
[["Southampton",0],["Ipswich Town",1]],
[["Queens Park Rangers",1],["Swansea City",1]],
[["Preston North End",2],["Birmingham City",1]],
[["Cardiff City",3],["Coventry City",2]],
[["Millwall",0],["Leeds United",3]],
[["Cardiff City",2],["Swansea City",0]],
[["Bristol City",0],["West Bromwich Albion",0]],
[["Blackburn Rovers",2],["Middlesbrough",1]],
[["Huddersfield Town",2],["Rotherham United",0]],
[["Sheffield Wednesday",0],["Ipswich Town",1]],
[["Norwich City",1],["Stoke City",0]],
[["Queens Park Rangers",1],["Sunderland",3]],
[["Watford",2],["Birmingham City",0]],
[["Preston North End",2],["Plymouth Argyle",1]],
[["Southampton",1],["Leicester City",4]],
[["Hull City",1],["Coventry City",1]],
[["Plymouth Argyle",3],["Blackburn Rovers",0]],
[["Ipswich Town",3],["Cardiff City",2]],
[["Leeds United",0],["Sheffield Wednesday",0]],
[["Leicester City",0],["Hull City",1]],
[["Middlesbrough",0],["Queens Park Rangers",2]],
[["Coventry City",3],["Watford",3]],
[["Rotherham United",2],["Norwich City",1]],
[["West Bromwich Albion",1],["Huddersfield Town",2]],
[["Stoke City",0],["Preston North End",2]],
[["Swansea City",1],["Bristol City",2]],
[["Birmingham City",1],["Millwall",1]],
[["Watford",0],["Blackburn Rovers",1]],
[["Ipswich Town",3],["Leeds United",4]],
[["Birmingham City",2],["Plymouth Argyle",1]],
[["Cardiff City",2],["Sheffield Wednesday",1]],
[["Coventry City",0],["Sunderland",0]],
[["Huddersfield Town",0],["Norwich City",4]],
[["Preston North End",2],["Swansea City",1]],
[["Millwall",1],["Stoke City",0]],
[["Rotherham United",1],["Leicester City",2]],
[["Southampton",2],["Queens Park Rangers",1]],
[["West Bromwich Albion",4],["Middlesbrough",2]],
[["Hull City",1],["Bristol City",1]],
[["Norwich City",3],["Millwall",1]],
[["Middlesbrough",1],["Huddersfield Town",1]],
[["Bristol City",0],["Birmingham City",2]],
[["Blackburn Rovers",1],["Hull City",2]],
[["Leicester City",2],["Cardiff City",1]],
[["Sunderland",2],["Rotherham United",1]],
[["Queens Park Rangers",0],["Ipswich Town",1]],
[["Stoke City",1],["Watford",0]],
[["Swansea City",1],["Coventry City",1]],
[["Sheffield Wednesday",0],["Preston North End",1]],
[["Plymouth Argyle",1],["Southampton",2]],
[["Leeds United",1],["West Bromwich Albion",1]],
[["Millwall",0],["Bristol City",1]],
[["Birmingham City",1],["Leeds United",0]],
[["Cardiff City",1],["Queens Park Rangers",2]],
[["Hull City",4],["Sheffield Wednesday",2]],
[["Ipswich Town",2],["Stoke City",0]],
[["Huddersfield Town",0],["Leicester City",1]],
[["Preston North End",2],["Sunderland",1]],
[["Southampton",4],["Norwich City",4]],
[["Watford",0],["Plymouth Argyle",0]],
[["West Bromwich Albion",3],["Swansea City",2]],
[["Rotherham United",2],["Blackburn Rovers",2]],
[["Coventry City",3],["Middlesbrough",0]],
[["Sunderland",1],["Ipswich Town",2]],
[["Leeds United",2],["Cardiff City",2]],
[["Leicester City",2],["Coventry City",1]],
[["Blackburn Rovers",2],["West Bromwich Albion",1]],
[["Watford",4],["Queens Park Rangers",0]],
[["Swansea City",1],["Birmingham City",1]],
[["Stoke City",4],["Rotherham United",1]],
[["Plymouth Argyle",3],["Huddersfield Town",1]],
[["Norwich City",2],["Hull City",1]],
[["Bristol City",1],["Preston North End",1]],
[["Sheffield Wednesday",1],["Southampton",2]]

Points, goal difference, goals for (don’t need to be output)

65 34 55 Leicester City
58 21 53 Southampton
58 16 50 Ipswich Town
54 24 50 Leeds United
45 13 40 West Bromwich Albion
43 13 43 Coventry City
42 4 42 Hull City
41 3 46 Norwich City
40 7 45 Watford
40 6 37 Sunderland
40 1 42 Middlesbrough
38 -12 34 Preston North End
37 0 31 Bristol City
37 -4 35 Cardiff City
33 0 47 Plymouth Argyle
33 -6 38 Swansea City
33 -12 41 Blackburn Rovers
32 -7 29 Millwall
32 -7 27 Stoke City
32 -10 34 Birmingham City
27 -18 28 Huddersfield Town
24 -15 24 Queens Park Rangers
22 -24 22 Sheffield Wednesday
19 -27 25 Rotherham United

Output for this example (from highest to lowest)

Leicester City
Ipswich Town
Leeds United
West Bromwich Albion
Coventry City
Hull City
Norwich City
Preston North End
Bristol City
Cardiff City
Plymouth Argyle
Swansea City
Blackburn Rovers
Stoke City
Birmingham City
Huddersfield Town
Queens Park Rangers
Sheffield Wednesday
Rotherham United

Alternative with integers for team names


Shorter examples

All are given as [[first team, first team score],[second team, second team score]] but this order can be transposed if preferred.

[[1,1],[2,1]],[[2,2],[1,0]] -> 2,1
[[1,2],[2,3]],[[1,2],[3,2]],[[1,3],[4,1]],[[1,2],[5,1]],[[2,2],[3,4]],[[2,4],[4,2]],[[2,2],[5,2]],[[3,4],[4,2]],[[3,3],[5,2]],[[4,4],[5,2]],[[2,4],[1,2]],[[3,3],[1,3]],[[4,2],[1,3]],[[5,1],[1,2]],[[3,3],[2,3]],[[4,2],[2,3]],[[5,3],[2,1]],[[4,3],[3,1]],[[5,3],[3,2]],[[5,1],[4,3]] -> 2,1,3,4,5
[[1,3],[2,4]],[[1,3],[3,3]],[[2,0],[3,2]],[[2,3],[1,1]],[[3,4],[1,0]],[[3,3],[2,2]] -> 3,2,1
[[1,3],[2,2]],[[1,3],[3,1]],[[1,4],[4,0]],[[2,2],[3,2]],[[2,3],[4,3]],[[3,2],[4,1]],[[2,3],[1,2]],[[3,3],[1,4]],[[4,2],[1,2]],[[3,4],[2,1]],[[4,2],[2,2]],[[4,4],[3,2]] -> 1,3,2,4
[[1,0],[2,2]],[[1,2],[3,0]],[[1,2],[4,0]],[[2,1],[3,2]],[[2,2],[4,4]],[[3,3],[4,2]],[[2,4],[1,3]],[[3,2],[1,2]],[[4,3],[1,2]],[[3,2],[2,3]],[[4,2],[2,2]],[[4,4],[3,2]] -> 4,2,1,3


  1. The hardest bit seems to be checking head to head record. That’s in the rules, but does it over-complicate things?
  2. Are the examples, particularly the real-world one, too long?

How many ways does this string conform to this expression?

Given an expression, decide in how many ways could an inputted string consisting of only printable ascii conforms to that expression. The best way to explain how the expression works is with an example, so here is one.

Let's say the expression is a + b + c + a. That means the string should start with a contiguous substring a, then at some point split into substring b, and finally end with substring a again (is this example, a, b, and c must be distinct.) Now let's say the string is "hello world please subscribe hello". One possible way would be:

a = "hello"
b = " world "
c = " please subscribe "

You task is to find how many ways you can split up the string so that the resulting substrings conform to the expression. If no split exists, output/return 0.

[more coming soon]


Tile the untileable

Only triangles, squares, and hexagons can tile perfectly with no gaps. With any other polygon, there will always be gaps. But what if you could tile with say, a pentagon? You just have to cheat, with other shapes. Given two integers a and b, how many x-sided polygons where a != x and x >= 3 are needed so that you can tile b a-sided polygons perfectly with the help of x-sided polygons? You may assume it is always possible.

More constraints

  • The area and perimeter of all a-sided polygons must be equal
  • ^ must also hold for the n x-sided polygons

[example and test cases coming soon]

  • I don't know how to do this at all.
  • The wording could probably be better.
  • \$\begingroup\$ "Only triangles, squares, and hexagons can tile perfectly with no gaps" You should have the word "regular" somewhere, otherwise this is wrong and sort of confusing. It's overall not clear to me what polygons are assumed to be regular in this question. \$\endgroup\$
    – Wheat Wizard Mod
    Commented Jan 30 at 5:28

Solve a squared cryptarithm


Summarise a Long Conversation

Note: I'm aware that there's been some attempts at doing chatgpt golf on the site but there's always been the problem of subjectivity. I've come up with an idea that could maybe add objectivity to the concept of general LLM golfing

Second note: prompt golf doesn't exist as a tag yet so it'd be created upon question posting most likely if at all

Final note: this might be better as a meta discussion, but just to kick things off I've made it a sandbox post

Inspired by a real life problem

If you ever been in a busy SE chat room/discord server/whatsapp group chat or any other place where you can talk over the internet and there's lots of messages, you'll know that it can be hard to keep up with what's being discussed. Especially if you've been away for a while (e.g sleep) and there's literal hundreds of new messages.

Your task today is to take a list of messages and summarise it into a nice digestible format.

"But that's a hard problem people have spent years researching and everything like how do you expect us to write a summarisation algorithm that's actually good without using something like a LLM?"

By using a LLM, obviously.


Given a series of messages with each individual message on a new line, write a prompt that summarises the content.

To verify that the output is actually a summary, the result will be run by an oracle prompt in <insert LLM that'll be used for testing>:

<prompt I've yet to write that outputs either yes or no depending on whether the oracle LLM would summarise in the same way>

To account for the non-deterministic behaviour of LLMs (their temperature), your prompt must return an accepted result for at least 4 out of 5 runs. required run rate subject to change. This is to establish that it's a genuinely working prompt and not a fluke.

Alternatively, if your LLM has a temperature setting you can set to 0, or is deterministic by default only one verified run is needed.

Input Format

name: message
name: message


to be finalised - I might decide to switch up how this challenge is scored

  • Inputs will not be longer than 1000 characters (to ensure no token limits are reached)
  • Prompts that try to return results that jailbreak the oracle are allowed, but note that you'll probably find better results by just doing the task legitimately.
  • LLMs you can use are Chatgpt 3.5/ 4 and Google Bard.
  • provide links to sample runs if possible.
  • The answer(s) with the shortest prompt as measured in utf-8 bytes wins.

Example Inputs


Sandbox meta

  • Does this work towards solving the subjectivity problem of prompt golf?
  • Does the testing/verification method need more runs or a different set-up?
  • Is prompt golf even something that should be a challenge?
  • Are there any other things I haven't thought of?
  • \$\begingroup\$ So basically, you are given a transcript and give a prompt to an LLM to summarize the transcript, right? How do you compare how good summarizations are? \$\endgroup\$ Commented Jan 30 at 13:11
  • \$\begingroup\$ @AlanBreadel that's what the Oracle LLM is for. It's used to determine whether an output is valid. \$\endgroup\$
    – lyxal
    Commented Jan 30 at 13:41
  • \$\begingroup\$ How do you make sure the Oracle LLM isn't biased? (for example the oracle gives a higher score to prompts that praise it) \$\endgroup\$ Commented Jan 30 at 14:53


The GSM7 03.38 protocol specifies a bit packing/unpacking algorithm, to pack septets into octets and vice-versa.

The following https://www.codeproject.com/Tips/470755/Encoding-Decoding-7-bit-User-Data-for-SMS-PDU-PDU is a reasonable reference implementation, which details the packing algorithm.


the packing algorithm - shortest code wins.


byte array in a style relevant to your language


packed byte array

You can use http://smstools3.kekekasvi.com/topic.php?id=288 to check your work - enter some text at the top, click convert, convert again, and then "User data translation (7 bit only)" for a handy comparison chart between the octets and septets.


The TAK function (easy mode)


Modular Equivalence


3D Hide & Seek Word Puzzle


Solve a logic puzzle by exhaustively applying three rules to rows and columns of a table

  • \$\begingroup\$ @noodleman Thanks for your feedback on my original post. Are the examples in this post clear enough? \$\endgroup\$
    – oldsoul
    Commented Feb 4 at 1:03

Alternating Random Series Sum To \$N\$


Counting rankings


State compression

A long time ago in a challenge far, far away, golfers were tasked with outputting one of three different outputs, depending on whether the input was: OR, one of the other 49 American states' two-letter abbreviations, or something else entirely. The list of these letter pairs looks like this:


The standard approach to achieve the task was to search for the input in this string, bar the commas but not the spaces. If the spaces were to be removed, unintended letter pairs would appear within the string. For example, this string would start with ALAKAZ and while the newly formed LA is one of the valid pairs (and hence, did not need to appear again in the search string), the same cannot be said for KA. (And you'd probably anger some people from Kansas. I dunno, I've no idea what people from Kansas get up to.)

But, with some careful rearrangement, the technique could be used in certain places to save a handful of bytes. The string that most solutions ended up using looked like this:


Pretty unrecognizable, right? If you look at the first "word", MINCALA, it contains MI, IN, NC, CA, AL, and LA, which are all valid pairs. But if you were to remove the space after it, then you would end up with AM, which is not a valid pair.

Thing is though, I'm still not entirely certain this string is optimal, which is why I'm asking you to...


Write a program/function that takes a list of strings of uniform length and outputs the shortest list of combinations that, when combined into a string with some delimiter, contains all the input strings, but no other string of the same length without that delimiter.


  • Standard I/O rules apply.
  • Standard loopholes are forbidden.
  • This challenge is not about finding the shortest approach in all languages, rather, it is about finding the shortest approach in each language.
  • Your code will be scored in bytes, unless otherwise specified.
  • Built-in functions that achieve this (now that's unlikely) are allowed but including a solution that doesn't rely on a built-in is encouraged.
  • Explanations, even for "practical" languages, are encouraged.

Test cases

Yet to come.

This challenge was sandboxed.


  • This title still sucks.
  • 1
    \$\begingroup\$ Is it allowed for a string to appear multiple times in the search string? I'm not sure how this could work with nonuniform lengths. What do you mean by a decision-problem? Testing if a given search string is valid? This seems very different, and IMO this question is more interesting. \$\endgroup\$ Commented Feb 3 at 17:47
  • \$\begingroup\$ @CommandMaster I'm not against strings appearing multiple times in the output inherently but I don't know if that can happen in the optimal output. As for the kind of challenge it is, I have decided it'll be a code-golf. \$\endgroup\$ Commented Feb 7 at 12:10
  • \$\begingroup\$ A typical solution may works in \$O((n+1)!k)\$ where \$n\$ is the number of candidate strings and \$k\$ is the size of strings. As the result, it could probably cannot handle any large testcases. \$\endgroup\$
    – tsh
    Commented Mar 6 at 11:17
  • \$\begingroup\$ Maybe testcase "EAB ABC BCA CAB BCE" -> "EABCABCE" use "ABC" twice \$\endgroup\$
    – tsh
    Commented Mar 6 at 11:20
139 140
142 143

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .