text
stringlengths
180
608k
[Question] [ *Inspired by [The Great API Easter Egg Hunt!](https://codegolf.stackexchange.com/questions/160577/the-great-api-easter-egg-hunt)* # Summary Your task is to search for a predetermined integer in the "Collatz space" (to be explained later) using the fewest step possible. # Introduction This challenge is ...
[Question] [ Write a function or program that, when given a list of names, outputs or returns a list where duplicates of given names have a unique shortened version of their surname. ### Input: A list of names, where a name is defined by a given name and a last name separated by a space. Names are non-empty string...
[Question] [ *[related](https://codegolf.stackexchange.com/questions/61097/golf-me-an-oop)* --- # What's assignable to what? In this challenge you will be given two types, `A` and `B` and determine if `A` is assignable to `B`, `B` is assignable to `A`, or neither. ## The Type System (I will use `t` to represent any...
[Question] [ Fortress was a language being developed by the Sun Programming Language Research Group (R.I.P. Fortress) that had a unique property to it, it was possible to render ("Fortify") programs in different font-styles (i.e. blackboard bold, bold, italics, roman, etc. ). The goal is to represent a one-char For...
[Question] [ **Background** Brag is a card game similar in concept to, but simpler than, poker. A hand in brag consists of three cards and is ranked as follows from highest to lowest: * Three of a kind - all three cards the same rank. Named as "three Kings" etc. * Running flush aka straight flush. All three cards o...
[Question] [ # Tic-Tac-Latin! ### This is a true story, so names have been altered. My latin teacher, Mr. Latin, created his own proprietary (no joke) tic tac toe variant. Let's call it tic-tac-latin. The game is simple, it is essentially tic tac toe played on a four by four grid. # Formal rule declaration A line ...
[Question] [ Consider binary [block diagonal matrices](https://en.wikipedia.org/wiki/Block_matrix#Block_diagonal_matrices) which have square blocks of 1s on the main diagonal, and are 0 everywhere else. Let's call such matrices "valid" matrices. For example, here are some valid 4x4 matrices: ``` 1 0 0 0 1 1 0 0...
[Question] [ Write a program or function that takes in a positive integer N. Output a list of all the distinct decimal numbers that can be written *in exactly N characters* using digits (`0123456789`), decimal points (`.`), and negative signs (`-`). For example, some numbers that would be in the N = 4 output list a...
[Question] [ # Introduction Finally the movie company is financing your film. They have given you a maximum budget and they also set the running time of your movie. Now you can start with the pre-production. You have a bunch of scenes already planned, but not all of them will fit into the budget and the film would ...
[Question] [ Given input of a positive integer `n`, write a program that completes the following process. * Find the smallest positive integer greater than `n` that is a perfect square and is the concatenation of `n` and some other number. The order of the digits of `n` may not be changed. The number concatenated o...
[Question] [ This question is inspired by ongoing tournament of "the hooligan's game played by gentlemen", the [Rugby World Cup](https://en.wikipedia.org/wiki/2015_Rugby_World_Cup), which has just completed the pool stage. There are 20 teams in the tournament, and they are divided into 4 pools of 5 teams each. Duri...
[Question] [ Your task is to solve the [Longest Common Subsequence problem](https://en.wikipedia.org/wiki/Longest_common_subsequence_problem) for **n** strings of length 1000. A valid solution to the LCS problem for two or more strings **S1, … Sn** is any string **T** of maximal length such that the characters of *...
[Question] [ Is there a way in Golfscript to bring all of the diagonals of an array into a single array? For example, for the array ``` [[1 2 3][4 5 6][7 8 9]] ``` return ``` [[7][4 8][1 5 9][2 6][3]] ``` (not necessarily in that order) and for ``` ["ABCD""EFGH""IJKL"] ``` return ``` ["I""EJ""AFK""BGL""CH""D"] ``` ...
[Question] [ ## Problem Imagine 7 buckets lined up in a row. Each bucket can contain at most 2 apples. There are 13 apples labeled 1 through 13. They are distributed among the 7 buckets. For example, ``` {5,4}, {8,10}, {2,9}, {13,3}, {11,7}, {6,0}, {12,1} ``` Where 0 represents the empty space. The order in which t...
[Question] [ Given this text > > Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in volupta...
[Question] [ ### Rules: In this game you start at the top of a rectangular grid of size N x M made up of walls and open spaces. The input is N lines of M characters, where a `.` specifies an open space and a `x` specifies a wall. Your program should output the smallest number K such that there exists a path from th...
[Question] [ [A073329](http://oeis.org/A073329) is a sequence where the \$n\$th term is the \$n\$th number with exactly \$n\$ distinct prime factors. For example, \$a(3) = 60\$ as the first \$3\$ integers with \$3\$ distinct prime factors are \$30 = 2 \times 3 \times 5\$, \$42 = 2\times3\times7\$ and \$60 = 2^2 \ti...
[Question] [ My apologies for the wordiness. We had fun with it at work in our internal golfing, but it required a few emails for clarification, so I hope I captured most of that the first time. ## PROBLEM Given a “simulated” snowfall snapshot (as a string, stdin or parameter to your function/method), report on 4 v...
[Question] [ Some chess variants use interesting non-standard pieces. In order to concisely describe new pieces or to describe pieces without requiring everyone to memorize a bunch of non-standard names some new notation can be invented. In this challenge we are going to look at Parlett's movement notation and conv...
[Question] [ ## Background [**Minkowski addition**](https://en.wikipedia.org/wiki/Minkowski_addition) is a binary operation on two sets of points (usually geometric objects) in the Euclidean space. The Minkowski sum of two sets \$A\$ and \$B\$ is formally defined as follows: $$ A+B = \{\mathbf{a}+\mathbf{b}\,|\,\ma...
[Question] [ Inspired by [this Puzzling challenge](https://puzzling.stackexchange.com/q/100507). ## Challenge Given a 2D rectangular grid where each cell is either an empty space or a wall, find the path (or one of the paths) from the top left cell to the bottom right, which satisfies the following: 1. Only movemen...
[Question] [ Given a rectangular board of cells with some number of holes in it, determine whether it is possible to complete a "holey knight's tour" (That is, a path that visits every non-hole cell exactly once using only chess knight moves, not returning to the starting cell) that starts on the top-left cell. For...
[Question] [ Do you love watching cool timelapses of constructions or other massive work done in minutes? Lets make one here. We will be looking at an excavator digging quarry, making pictures each day to see whole progress. And your task is to show us this process! Quarry is defined by the width of its first lay...
[Question] [ **Mathematical Background** Let A be an N by N matrix of real numbers, b a vector of N real numbers and x a vector N unknown real numbers. A matrix equation is Ax = b. Jacobi's method is as follows: decompose A = D + R, where D is the matrix of diagonals, and R is the remaining entries. if you make an ...
[Question] [ You may know the mathematician von Koch by his famous snowflake. However he has more interesting computer science problems up his sleeves. Indeed, let's take a look at this conjecture: Given a tree with `n` nodes (thus `n-1` edges). Find a way to enumerate the nodes from `1` to `n` and, accordingly, th...
[Question] [ Given a string of ASCII art like such (This isn't ASCII art but it will do for the example): ``` abc d e fgh ``` Jumble it as if it was being displayed on a screen with one character per line, like so: ``` a b c d e f g h ``` Print the result, wait one second, ±0.5 seconds before clearing the terminal ...
[Question] [ ## Briefing You are a bot, in a 2D grid that extends infinitely in all four directions, north, south, east and west. When given a number, you must move the bot so that you get to the target number. Here's how the grid works: You can move in 4 directions: north, south, east or west. Once you move off a ...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- This question does not appear to be about code golf or coding challenges within the scope defined in the [help center](https://codegolf.stackexchange.com/help/on-topic). Closed 7 years ago....
[Question] [ # Background The task is simple but every programmer has implemented it at least once. Stackoverflow has a lot of samples, but are they short enough to win? # Problem story You're a grumpy programmer who was given the task of implementing file size input for the users. Since users don't use bytes every...
[Question] [ Given two parameters *lane pattern* and *road length*, print an ASCII representation of the lane markings for Roads and Traffic Service to paint the roads. ## Example input/output **Input:** `BTHMLRPHU`, 21 I don't care if you take two parameters or concatenate the number onto the end of the string, it...
[Question] [ This challenge is inspired by a puzzle I played, consisting of foam pieces like these: ![puzzle pieces](https://i.stack.imgur.com/yJSTT.jpg) which have to be assembled into 3D cubes, like these: ![solved cubes](https://i.stack.imgur.com/jfZU7.jpg) The puzzle pieces can be viewed as grids of 5 \* 5 squa...
[Question] [ Oh no! Nemo, our small clown fish is lost in this ASCII ocean and his dad Marlin is trying to find him. Your task is to get Marlin to Nemo safely. But beware, we have a feeding frenzy Bruce on the loose, so better avoid him at all costs! **Details** You are given a rectangular ASCII ocean grid containi...
[Question] [ This is based on [xkcd #153](http://xkcd.com/153/). Make a program or named function which takes 2 parameters, each of which is a string or a list or array of bytes or characters. The second parameter will only contain characters drawn from `lrfu` (or the equivalent ASCII bytes). It should be interpret...
[Question] [ **This challenge is not about the game Snake.** Imagine a 2d snake formed by drawing a horizontal line of length `n`. At integer points along its body, this snake can rotate its body by 90 degree. If we define the front of the snake to be on the far left to start with, the rotation will move the back p...
[Question] [ There are P parking spaces in a parking lot, though some spaces are occupied by cars represented by octothorpes `#` while the free spaces are dots `.`. Soon there arrive T trucks, each of which will take up exactly L consecutive spaces. The trucks don't have to be parked next to each other. Your task i...
[Question] [ Your challenge today is to implement a [t9](http://en.wikipedia.org/wiki/T9_(predictive_text))-like functionality. You will implement a function that will only have 2 parameters. You will receive 1 phone number in a string and the content of a text file with a list of words (don't assume a specific n...
[Question] [ ## Challenge Find the smallest cover of bases (e.g., moduli) whose sets of quadratic residue can be tested via table-lookup to definitively determine whether or not a given non-negative integer *n* is a perfect square. The bases must all be less than or equal to the square root of the maximum value of ...
[Question] [ Simply put, the Perrin sequence has the following recurrence relation: > > P(n) = P(n-2) + P(n-3); > > > P(0) = 3; P(1) = 0; P(2) = 2; > > > But wait!! There's more!! The Perrin sequence has a very bizarre property: > > If N is prime, then P(N) mod N = 0. > > > Furthermore, there are very few...
[Question] [ **The challenge** You are given a function `compile(s: String): Integer` which returns `0` if `s` could be compiled and anything other than `0` if it failed (the resulting code is not important). The thing is that you don't know for what language the function is made for, so it is up to you to figure...
[Question] [ From codegolf.com (not loading as of Sept 15, 2011) was one that was driving me crazy. Print to STDOUT a clock of an exacting form, reading time from STDIN and marking an `h` at the hour and `m` at minute (rounded down to a multiple of 5) and an `x` if they overlap, unused ticks are marked with an `o`,...
[Question] [ *Inspired by [How do you write dates in Latin?](https://latin.stackexchange.com/questions/1943/how-do-you-write-dates-in-latin)* ## Challenge Given a month-and-day date, output that date in abbreviated Latin, as explained below. ## Input Input is flexible, following conventions from other [date](/quest...
[Question] [ # Solve an Inglenook Sidings Puzzle ## Background The [Inglenook Sidings Puzzle](https://en.wikipedia.org/wiki/Inglenook_Sidings) is a shunting/switching yard puzzle by Alan Wright for model railroading. The rules for the puzzle are as follows: ([Source](http://www.wymann.info/ShuntingPuzzles/Inglenook...
[Question] [ # Background **Character classes** are a standard way to indicate a set of characters to match in regular expressions. For example, the class `[ab]` matches a or b, `[a-z]` matches any lower case letter, and `[^a]` matches everything but a. For the purpose of this question, classes can contain: * a seq...
[Question] [ ### Definition For any \$a\equiv1\ (\text{mod }8)\$ and \$n\ge3\$, there are exactly 4 roots to the equation \$x^2\equiv a\ (\text{mod }2^n)\$. Now, let \$x\_k(a)\$ be the smallest root to the equation \$x^2\equiv a\ (\text{mod }2^k)\$, then $$\{x\_3(a),x\_4(a),x\_5(a),x\_6(a),\cdots\}$$ is a smallest ...
[Question] [ # Crossing Sequences Given a list of positive integers `A`, call it an *increasing sequence* if each element is greater than or equal to the previous one; and call it a *decreasing sequence* if each element is less than or equal to the previous one. Some increasing sequences: ``` [1,2,4,7] [3,4,4,5] [2...
[Question] [ Given a polynomial in one variable with rational coefficients, output an equivalent expression containing only `1`, variables, and definite integrals. For example, -*x*2 can be expressed as ∫*x*∫111d*t**x*d*u*. `E := 1 | var | ∫EEEdvar` Any reasonable input/output method is allowed. Examples: [![\Large...
[Question] [ The task is to compute [OEIS A005434](https://oeis.org/A005434) as quickly as possible. Consider a binary string `S` of length `n`. Indexing from `1`, we can determine if `S[1..i+1]` matches `S[n-i..n]` exactly for all `i` in order from `0` to `n-1`. For example, ``` S = 01010 ``` gives ``` [Y, N, Y, ...
[Question] [ Some of you may say that I am wasting my time, but this task does not give me peace for more than 500 days. It is required to write a program in **Python 3.x** that takes two numbers as input and displays their sum. The numbers are given in the following format: ``` a b ``` Some example test cases: ```...
[Question] [ Today your challenge is to produce all possible full parenthesizations of an expression. Your input is a single line of printable ASCII containing one or more terms separated by operators. The input might also contains spaces - you must ignore these. A term is `[a-zA-Z0-9]`, an operator is `[^ ()a-zA-Z...
[Question] [ Given a positive integer below 1000, display all possible rectangles with that area. # Task Let's say the input is 20. We can make a rectangle 20×1, 10×2, or 5×4, so this is a valid output: ``` ******************** ********** ********** ***** ***** ***** ***** ``` Note that each possible rectangle appe...
[Question] [ My high school, and many others implement a type of schedule called a Rotating Block Schedule. This is a way for people to have 8 classes, but on have 6 periods in a school day. There are four days in a block schedule that repeat over and over, and have nothing to do with the actual days of the week. E...
[Question] [ I recently got a new Sudoku app that produces really hard Sudoku's, which can't be solved using the standard strategies. So I had to learn a few new ones. One of these strategies is the **Y-Wing Strategy**. It is ranked under "Tough Strategies", but it is actually not that hard. # Example For this str...
[Question] [ # The Game Most of us know about [Frogger](http://en.wikipedia.org/wiki/Frogger), the 80's era arcade game where the objective is to hop a frog safely across a busy highway and a hazard-filled pond to arrive safely at home. A [challenge was issued](https://codegolf.stackexchange.com/questions/26824/fro...
[Question] [ There’s already been a question about [simulating the Monty Hall Problem](https://codegolf.stackexchange.com/q/12693). This one is different. The *user* will *play* the Monty Hall Problem. Your program will play the role of the host. Montybot, if you like. Here are the steps: 1. Pick (randomly) which ...
[Question] [ Santa's elves need help in determining if their current batch of presents will fit into santa's sleigh. Write the shortest program possible in the language of your choice to help them out. ## Constraints * Santa's sleigh measures 6ft wide by 12ft long and is 4ft deep. * Presents may be fragile, so they...
[Question] [ This is an extension of [Simulate a Minsky Register Machine (I)](https://codegolf.stackexchange.com/questions/1864). I'm not going to repeat all of the description there, so please read that problem description first. The grammar in part (I) was as simple as possible, but results in rather long program...
[Question] [ The task is to find a way to draw a horizontal line in an array of 16-bit integers. We're assuming a 256x192 pixel array with 16 pixels per word. A line is a contiguous run of set (1) bits. Lines can start in the middle of any word, overlap any other words, and end in any word; they may also start and...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win. Closed 4 years ago. [Improve this quest...
[Question] [ Your input is a ragged list of possibly empty lists of non-negative integers. For example, `[[2,0],[[]],[[[],[1],[]],[]]]` is a valid input. This input is a "compressed" ragged list. What this means is that when we have a list of numbers, we interpret those as a list of indices, indexing the output. Fo...
[Question] [ Consider the Tetris pieces, but made out of some number of ([hyper](https://en.wikipedia.org/wiki/Hypercube))cubes instead of four squares, where two blocks are considered the same if one is a rotation, reflection, or translation of another. The goal of this challenge is to take two positive integer in...
[Question] [ [Tichu](https://en.wikipedia.org/wiki/Tichu) is a card game in which players take turn playing sets of cards from a deck consisting of a standard 52-card deck, plus 4 additional cards: * the **dragon**, which has a greater value than any other card * the **phoenix**, which can act as a wildcard * the *...
[Question] [ I feel tired to do "find the pattern" exercise such as ``` 1 2 3 4 (5) 1 2 4 8 (16) 1 2 3 5 8 (13) ``` Please write a program that finds the pattern for me. Here, we define the pattern as a recurrence relation that fits the given input, with the smallest score. If there are multiple answers with the sa...
[Question] [ **This question already has answers here**: [Word Search Puzzle](/questions/37940/word-search-puzzle) (12 answers) Closed 5 years ago. # The Challenge Given a list of words and a grid of letters, your job is to determine which of the given words can be found on the grid in all 8 directions (forw...
[Question] [ **This question already has answers here**: [Leaderboard golf](/questions/111735/leaderboard-golf) (4 answers) Closed 6 years ago. Have you ever found a good challenge to answer, answered it and then found out somebody posted a solution with a better score in *the same language*? ## Challenge Wr...
[Question] [ There is a Sioux village. It has a totem: ``` __ ___| |___ \/ \ / \/ /\ ``| |`` /\ /^^\ | | /^^\ / /\ \ | | / /\ \ '''''''''''''''''''''''''''' ``` The totem lets the Sioux mastering the weather for helping in their different tas...
[Question] [ # K-Means Clustering ([Wikipedia](https://en.wikipedia.org/wiki/K-means_clustering)) The task here is rather simple, perform a single iteration of a k-means clustering algorithm on a binary matrix. This is essentially the setup task for the main k-means algorithm, I felt the setup might be easier and e...
[Question] [ Based on [THIS](https://codegolf.stackexchange.com/questions/102723/balancing-a-string-using-a-stack) question. Given a string, replace each bracket `()[]{}<>` with a bracket of the appropriate type so that the brackets match, and the nested brackets cycle as follows: 1. Outermost ones are `()` 2. Dir...
[Question] [ # Challenge description A **Langford string** of order `N` is defined as follows: * The length of the string is equal to `2*N`, * The string contains first `N` letters of the English alphabet, each letter appearing twice, * For each pair of the same letters, there are `M` letters between them, where `M...
[Question] [ In the game Stratego, the main game mechanic is when you attack an opponent's piece with yours. In this challenge, you job is to simulate one of these battles and say who survives. # Specs You will get as input a pair of string representing Stratego pieces. The pieces are one of `"S 1 2 3 4 5 6 7 8 9 1...
[Question] [ My local ACM chapter gives out door prizes to people who come to the meetings. You get an increased chance of winning if you solve the programming puzzle, however (but *I* always solve that puzzle). Thus, some people have 1 entry, while others have 2. But wait! The way the raffle program works is not b...
[Question] [ Write some code that takes a single non-negative integer \$n\$ and outputs the \$n\$th power of phi (\$\phi\$, the Golden Ratio, approximately 1.61803398874989) with the same number of decimal digits as the \$n\$th Fibonacci number. Your code must produce the correct sequence of digits for all inputs u...
[Question] [ (FB, or Functional-Basic, as found here [Interpret Functional-Basic](https://codegolf.stackexchange.com/questions/69505/interpret-functional-basic)) ## Task Implement a linting program for FB, similar to JSLint for JavaScript. ## Error types ### Invalid identifier Identifiers can only have upper and lo...
[Question] [ # About Functional-Basic Functional-Basic (FB for short) is a language that only allows numbers and lists. Basic features, such as the `if` statement are missing in an attempt to simplify the language. Everything in this language is immutable. `input` is always assigned to the script input, which can b...
[Question] [ ## Input A matrix `M` represented as two space separated lines of integers. Each line will have the same number of integers and each integer will be either -1 or 1. The number of integers per line will be at most 20. `M` will therefore be `2` by `n` where `n` is the number of integers on each of the tw...
[Question] [ [Innovation](https://boardgamegeek.com/boardgame/63888/innovation) is a card game where players battle through the ages, from prehistory to modern times, in an attempt to earn achievements faster than their opponents. Each card in Innovation is unique, and provides a player with a number of icons. If w...
[Question] [ Lots of people like to play music for fun and entertainment. Unfortunately, music is pretty difficult sometimes. That is why you're here! ## Task It's your job to make reading music much easier for those struggling with it. You need to write a program or function that takes as input a musical staff, an...
[Question] [ Write a program or function that, given two ASCII strings `A` and `B`, will produce strings `A'` and `B'` where the common substrings are reversed in their place. The process for finding `A'` is as follows: 1. `A'` is initially empty. 2. If the first character of `A` is in `B`, find the longest prefix ...
[Question] [ The Doctor, in trying to escape from the Dalek forces has decided to send them in a spin by traveling in various pockets of space in a spiral motion. Depending on the nature of the available space-time, The Doctor needs to enter into the TARDIS controls the height and width of the section of space and ...
[Question] [ Consider a grid of `N`x`N` unique elements. Each element has a letter (from A to the `N`th letter, inclusive) and a number (from 1 to `N`, inclusive). Hence, each number/letter pair is in the grid exactly once. Your job is to arrange a grid such that: Each row, column, and diagonal (including wrapping)...
[Question] [ This is the reverse of [Music: what's in this chord?](https://codegolf.stackexchange.com/q/24816/25180), which is to print the notes in a given chord. This time the input is a list of notes in a chord, and your task is to output which chord it is. Your program should support the following triadic chord...
[Question] [ You've been hired to write some code for a dictation-taking app, which takes voice input from a spoken source, parses it as words, and writes it down on a screen. The management doesn't really trust you with all that much powerin the project—you're known to sit around and golf code all day instead of d...
[Question] [ In the highly underrated Steampunk novel *The Difference Engine*, the equivalent of cinema houses delivered a pixelated moving image displayed by tiles which could be flipped mechanically. The control engine for orchestrating the movement of the these tiles was a large noisy machine controlled by a dec...
[Question] [ Write a function or program to validate an e-mail address against RFC [5321](https://www.rfc-editor.org/rfc/rfc5321) (some grammar rules found in [5322](https://www.rfc-editor.org/rfc/rfc5322)) with the relaxation that you can ignore comments and folding whitespace (`CFWS`) and generalised address lite...
[Question] [ The input consists of *i* rows with neighbors information. Each *i*th row contains 4 values, representing the neighbor of *i* to the **North**, **East**, **South** and **West** directions, respectively. So each value represents a neighbor at the given direction of the *i*th row, starting from row 1, an...
[Question] [ ## Balanced ternary logic Ternary is normally another name for base 3, that is to say, each digit is `0`, `1`, or `2`, and each place is worth 3 times as much as the next place. Balanced ternary is a modification of ternary which uses digits of `-1`, `0` and `1`. This has the advantage of not needing a...
[Question] [ ## Degree of Unsaturation This is not a particularly hard code puzzle - but I'm interested to see your multiple ways of solving it. The Degree of Unsaturation is the number of double chemical bonds between atoms, and/or the number rings in a chemical compound. You will be given the molecular formula o...
[Question] [ # Challenge Given two question IDs, try to figure out how similar they are by looking at the answers. # Details You will be given two question IDs for `codegolf.stackexchange.com`; you may assume that there exist questions for both IDs that are not deleted, but are not necessarily open. You must run th...
[Question] [ There has recently been a big snow, and my driveway needs snow-blowing. If the snow-blower goes over some area that it has already snow-blowed, then that area will have snow blown onto it and need to be blown again. And of course, the snow-blower cannot start in the middle of the driveway, it needs to ...
[Question] [ ## Intro The Switching sequence is defined like so: Start with `n` people standing in a circle (`6` for this example). ``` 1 2 6 3 5 4 ``` Starting from person `1`, the person that is to the left of the "chosen" person is removed. ``` 1 6 3 5 4 ``` The removed person can "switch" the remov...
[Question] [ This programming puzzle is inspired by another question which has been asked here yesterday but which was deleted by the author... **The challenge:** Create an executable binary (Windows .EXE or Linux binary) using Visual C# (or your favorite C# IDE) which prints the following text to the standard outp...
[Question] [ *This challenge is the first in a two-challenge series about Repetition. The second will be up soon.* In a language called Repetition (something I just made up), there consists an infinite string of `12345678901234567890...`, with `1234567890` repeating forever. The following syntax is available to out...
[Question] [ Inspired by [**this answer**](https://math.stackexchange.com/a/1686299/206300) (emphasis mine): > > We will play a game. Suppose you have some number ***x***. You start with ***x*** and then you can add, subtract, multiply, or divide by any integer, except zero. You can also multiply by ***x***. You c...
[Question] [ Children are very good at classifying objects and counting them. Computers seem to have more trouble. This is a simplified version of this problem. Can you write a small program that can classify and count objects in an image? The problem: Given an image containing one or more circles and rectangles, r...
[Question] [ Inspired by [this little game](http://lh5.ggpht.com/-uptxy9lVSd4/UYBVI_4FfnI/AAAAAAAADTE/EtXviYI-UCo/s640/4_1367364793905.png). ## Challenge Given as input the initial position of a grid (always 5x5), like this: ``` -ABCD -A--- ---C- ---BD --E-E ``` You need to connect the letters (same letters all tog...
[Question] [ Last year, there was a very popular challenge to [create an image containing every 24-bit RGB colour](https://codegolf.stackexchange.com/questions/22144/images-with-all-colors). My challenge is to create a smooth animation (24 frames/s say), where the colour of every pixel of every frame is unique. I w...
[Question] [ A [tree](https://en.wikipedia.org/wiki/Tree_(graph_theory)) is a connected, undirected graph with no cycles. Your task is to count how many distinct trees there are with a given number of vertices. Two trees are considered distinct if they are not [isomorphic](https://en.wikipedia.org/wiki/Graph_isomor...
[Question] [ This is a screenshot of some text typed in a text editor: ![16px-high text](https://i.stack.imgur.com/AjJnH.png) This is the same text at a larger size. ![96px-high text](https://i.stack.imgur.com/gBN1g.png) Notice how visible the [aliasing](http://en.wikipedia.org/wiki/Aliasing) is on letters with pro...
[Question] [ Almost every language has a built-in function that can split a string at a given position. However, as soon as you have html tags in the string, the built-in function will not work properly. Your task is to write a program or function which splits a string at the nth character but does not count charac...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win. Closed 7 years ago. [Improve this quest...
[Question] [ Flow Free is an addictive android game where you have to connect pairs of elements together via non-overlapping snakes and fill the entire grid. For a description, see here: <https://play.google.com/store/apps/details?id=com.bigduckgames.flow&hl=en> I have an ASP (answer set programming) solution which...