text
stringlengths
180
608k
[Question] [ Given: * A natural number **S**. * A list of N rational weights **W** that sum to 1. Return a list **L** of N non-negative integers, such that: ``` (1) sum(L) = S (2) sum((S‚ãÖW_i - L_i)^2) is minimal ``` In other words, approximate `S‚ãÖW_i`s with integers as closely as possible. Examples: ``` 1 [0.4 ...
[Question] [ For a given positive integer number N, write a complete program to find the minimal natural M such that the product of digits of M is equal N. N is less than 1,000,000,000. If no M exists, print -1. Your code should not take more than 10 secs for any case. ``` Sample Inputs 1 3 15 10 123456789 32 432 ...
[Question] [ We already have a challenge for [computing the GCD of two Gaussian integers](https://codegolf.stackexchange.com/questions/231182/greatest-common-gaussian-divisor), but that challenge explicitly allows to choose any of the four possible values. Your task now is to bring the Gaussian integer computed by ...
[Question] [ Write a program that produces mirror images of itself. An example, would be the [fantastic camel code](http://www.perlmonks.org/?node_id=45213) that reads it's own code and produces two smaller 2x2 versions. Given the input: ``` $_='ev ...
[Question] [ # Introduction Compute is a ~~esoteric~~ joke language. From the [esolangs entry:](http://esolangs.org/wiki/Compute) > > Compute has no required syntax and has the power to solve any and all > problems. It is smart enough to interpret any human language (English, > Spanish, Latin, etc), any programmin...
[Question] [ ## Problem You are tasked with creating a program that performs emoji encryption on a given string of emojis. In this encryption scheme, each emoji is replaced by a unique character (from `a` to `z`). Your program should take an emoji string as input and output the corresponding encrypted string. The m...
[Question] [ ``` 4, 32, 317, 3163, 31623, 316228, 3162278, 31622777, 316227767, 3162277661, 31622776602, 316227766017, 3162277660169, 31622776601684, 316227766016838, 3162277660168380, 31622776601683794, 316227766016837934, 3162277660168379332, 31622776601683793320, 316227766016837933200, 3162277660168379331999, 31...
[Question] [ > > Dialogue by a 3Der. > > > I was hired by Sr. 4Der to learn the 4D universe and I was willing to get to know more about it. But since I am a 3Der, I wouldn't see him, nor would I know how the real shapes look like. All I can do is illustrate. Sr. 4Der is pretty much invisible to us. We can't see...
[Question] [ Tom the lumberjack is going to do his daily routine: chop trees. After all, it's his job to do so. His boss has ordered him to chop trees in a straight line marked with a special tape to identify them, so he knows which trees he is going to have to chop. However, Tom quickly realizes he has a problem. ...
[Question] [ Given a value *x* find the smallest numerical value greater than *y* that is capable of being multiplied and divided by *x* while retaining all original digits. * The new numbers do not lose digits. * The new numbers do not gain digits. For example: > > Input: x = 2, y = 250000 > > > * Original: 285...
[Question] [ Your goal in this code golf is to take two strings, `language` and `code` *(if the golfed code you wrote for this is multiline, then this variable would be multiline.)*, and one integer, `bytes`. They represent the variables for a programming language, number of bytes it takes, and the code itself. Aft...
[Question] [ Write a program or function, that given a success probability *p*, a number *n* and a number of trials *m* returns the chance of **at least** *n* successes out of *m* trials. Your answer must be precise to at least 5 digits after the decimal. Test cases: ``` 0.1, 10, 100 -> 0.54871 0.2, 10, 100 -> 0....
[Question] [ You should write a program or function which receives an integers as input and outputs or returns two integers whose sum is the first one. There is one further requirement: **no number can be part of the output for two different inputs**. ## Details * You should be able to handle inputs for at least th...
[Question] [ In the language of your choice, write a program that is arranged in the shape of a Christmas tree that prints itself in the same shape. What is not allowed: * Printing out the source file * Code that is nothing but statements that get echoed by an interpreter by virtue of them being literals (eg just u...
[Question] [ ## Background You have again x3 been given the task of calculating the number of landmines in a field. But this time, we have no landmine number, and some landmines have exploded. You must calculate the landmine score given a string of numbers. This is the landscape. You have no landmine number to star...
[Question] [ Let's solve the [same task as in this challenge](https://codegolf.stackexchange.com/q/204426/25315) but faster! **Input**: a non-empty string containing letters a-z **Output**: the length of a longest (contiguous) substring in which all letters are different **Time and space complexity**: O(n). The num...
[Question] [ You want to create a square chessboard. Adjacent tiles must alternate black and white like a standard chessboard, and the bottom left corner can be either black or white. Your program will take in two positive integers, the number of black and the number of white tiles. These will always be less than 1...
[Question] [ In the absurdist play *[Rosencrantz and Guildenstern are Dead](https://d3jc3ahdjad7x7.cloudfront.net/HgjKbM59FD5bFo4Khi3czmVu0dUiw1Pru7Lya3BKNaDtfvrn.pdf)*, the two main characters **Rosencrantz** and **Guildenstern**(or are they?) are always mixing up which of them is who—or sometimes which of their o...
[Question] [ **The challenge is simple** Write a script that, when given a string input, will hash the string using the [MD2 hashing algorithm](https://en.wikipedia.org/wiki/MD2_(cryptography)), and then return either a positive integer or negative integer output based on which character set below is more common in...
[Question] [ Building a golfed rot13 encryptor is too easy because the letters are all the same order in the ASCII character space. Let's try a rot32 engine instead. Your task is to build a function that takes a Base64 string as input and returns the same string but with each letter rotated 32 symbols from its orig...
[Question] [ What general tips do you have for golfing in TypeScript's type system? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to TypeScript's type system (e.g. "remove comments" is not an answer). Please post one tip per answer. If you're not fami...
[Question] [ **This question already has answers here**: [Find prime gaps](/questions/137435/find-prime-gaps) (23 answers) Closed 5 years ago. Given an integer *n*, output the smallest prime such that the difference between it and the next prime is at least *n*. For example, if `n=5`, you would output `23`, ...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/182175/edit). Closed 4 years ago. [Improve this question](/posts/182175/edit)...
[Question] [ Create quine variant such that the program prints its first character, then the first two, then three and so on until the whole program is printed. ## Example Suppose your code is `@@@@@2` in some language. Then the output should be ``` @ @@ @@@ @@@@ @@@@@ @@@@@2 ``` in that order, each line separated ...
[Question] [ *Note, when I say "negate", I mean replace all ones with zeroes (i.e. a bitwise negation)* The Thue-Morse sequence goes like 01101001 The way you generate it is: Start by taking 0. Negate what is left and append it to the end. So, take `0`. Negate it and add that to the end - `01` Then take that and ne...
[Question] [ The Debian Linux distribution (and Debian-based distros, like Ubuntu, Kali and others) uses a package-manager called APT. To install program `foo` you would type into a terminal ``` sudo apt-get install foo ``` One little Easter Egg of APT is the following ``` apt-get moo ``` Which after typing will p...
[Question] [ Is it possible to make this C code smaller? It prints out all primes from 0 to 1000. **C, 89 chars** ``` int i,p,c;for(i=2;i<1e3;i++){c=0;for(p=2;p<i;p++)if(i%p==0)c++;if(c==0)printf("%u\n",i);} ``` [Answer] # 67 bytes In C there's no real alternative to trial division, but it can certainly be gol...
[Question] [ This is the companion question to [Jumblers vs Rebuilders: Coding with Tetris Bricks](https://codegolf.stackexchange.com/questions/40140/jumblers-vs-rebuilders-coding-with-tetris-bricks) where Rebuilders can post their solutions. As argued in [Where should we put robbers?](https://codegolf.meta.stackex...
[Question] [ Groups are a widely used structure in Mathematics, and have applications in Computer Science. This code challenge is about the fewest # of characters to create a group table for the additive group Zn. How the table is constructed: For Zn, the elements are {0, 1, 2, ..., n-1}. The table will have n rows...
[Question] [ Given a string of different characters, and a number n, generate all the ordered combinations with repetition, of length 1 to n, using those characters. Another way to define it is to see the given characters as "custom" digits in the base (radix) of the number of characters, then the program should ge...
[Question] [ Equilibrium index of a sequence is an index such that the sum of elements at lower indexes is equal to the sum of elements at higher indexes. For example, in a sequence A: ``` A[0]=-7 A[1]=1 A[2]=5 A[3]=2 A[4]=-4 A[5]=3 A[6]=0 ``` 3 is an equilibrium index, because: ``` A[0]+A[1]+A[2]=A[4]+A[5]+A[6] ``...
[Question] [ Write a program that, given a small positive even integer from standard input, calculates the probability that flipping that many coins will result in half as many heads. For example, given 2 coins the possible outcomes are: ``` HH HT TH TT ``` where H and T are heads and tails. There are 2 outcomes (`...
[Question] [ ## The Challenge Given two vertexes and a point calculate the distance to the line segment defined by those points. This can be calculated with the following psudocode ``` def dist(point, v1, v2): direction := normalize(v2-v1) distance := length(v2-v1) difference := point ...
[Question] [ [Sandbox](https://codegolf.meta.stackexchange.com/a/18384/78850) *Adapted from exercise 8 of [100 little Keg exercises](https://github.com/JonoCode9374/100-Little-Keg-Exercises)* String manipulation is a very important part of any programming language. Consequently, that is what this challenge is about...
[Question] [ Given 3 input items, a list of coordinate pairs, a 2D string, and a single-character string, output whether the character at each coordinate of the 2D string is equal to the single character. You can take the input in any order and the coordinates may be 1-indexed. You may take the 2D string as a 2D li...
[Question] [ When doing weightlifting, I want to make a specific weight by attaching several plates to a bar. I have the following plates: * 6 plates of 1 kg each * 6 plates of 2.5 kg each * 6 plates of 5 kg each * 6 plates of 10 kg each The bar itself weighs 10 kg. It's only allowed to attach the plates in pairs -...
[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 8 years ago. [Improve this quest...
[Question] [ Develop a program to check if a given word is part of a language defined by the following rules: * The language has a set of rules. * The empty string is considered a valid word in the language. * Two words from the language can be concatenated to create a new word in the language. * If X is a word in ...
[Question] [ **Challenge** The goal of this challenge is to make a function that takes two paragraphs and output a concatenated result with removing the duplicated overlapped lines due to redundancy (but a single copy of the part of overlapped lines should be kept to avoid information loss). Each input paragraph is...
[Question] [ This is a follow-up to [Chess960 position generator](https://codegolf.stackexchange.com/questions/11901/chess960-position-generator). In [Chess960](http://en.wikipedia.org/wiki/Chess960), there are 960 possible starting positions that can be enumerated from 0 to 959 (or, at your choice, from 1 to 960)....
[Question] [ Part of [**Advent of Code Golf 2021**](https://codegolf.meta.stackexchange.com/q/24068/78410) event. See the linked meta post for details. The story continues from [AoC2018 Day 3](https://adventofcode.com/2018/day/3). *But you're not Bubbler, you're Lyxal! [yeah, I know.](https://chat.stackexchange.com...
[Question] [ ## Background A [Hamiltonian path](https://en.wikipedia.org/wiki/Hamiltonian_path) is a path on a graph that steps through its vertices exactly once. On a grid, this means stepping through every cell exactly once. On a square grid, a Chess King can move to a horizontally, vertically, or diagonally adja...
[Question] [ This is a simple(ish) web scraping challenge. **Input** Your code should take [an MPAA film rating](https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system) and a number from 0 to 100 as input. It can do this in any way you find convenient. **Output** Your code should ret...
[Question] [ # Challenge Convert and print out a time in a 12-hour format. `HH:MM AM/PM` ### Examples Input: * `'Fri Jun 30 2017 21:14:20 GMT-0700 (PDT)'` * `'Fri Jun 30 2017 00:10:23 GMT-0700 (PDT)'` * `'Fri Jun 30 2017 12:10:23 GMT-0700 (PDT)'` * `'Sat Jun 31 2018 8:06:20 GMT-0700 (PDT)'` * `'Fri Jul 01 2017 01:1...
[Question] [ # Positional Awareness Your task is to generate a program that, for every permutation of its characters (which includes the original program), outputs the positions of every character relative to the original program. If your program is ``` Derp ``` you must output ``` [0, 1, 2, 3] ``` (or some equival...
[Question] [ **This question already has answers here**: [A simple TCP server](/questions/76379/a-simple-tcp-server) (40 answers) Closed 7 years ago. Write the shortest program that answers "Hello, World" to a network connection. Conditions: * Program shall listen on port 12345 * When a client connects, prog...
[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 9 years ago. [Improve this quest...
[Question] [ ## Background You have again been given the task of calculating the number of landmines in a field. However, we have now travelled into the flatlands. You must calculate the landmine score given a list/string of numbers (which will be 2D) and the landmine number. The landmine number tells you where lan...
[Question] [ You're a plumber working on a house, and there's some pipes that must be connected at weird angles. You have 8°, 11.25°, 22.5°, 45°, and 90° fittings at your disposal, and you want to use as few as possible to match the angle as closely as possible. # Goal * Match the desired angle as closely as possib...
[Question] [ Related: [Elias omega coding: encoding](https://codegolf.stackexchange.com/q/219109/78410) ## Background [**Elias omega coding**](https://en.wikipedia.org/wiki/Elias_omega_coding) is a universal code which can encode positive integers of any size into a stream of bits. Given a stream of bits \$S\$, the...
[Question] [ Construct a program or function that takes input in form of ``` <width>, <height>, <color1>, <color2> ``` and generates an output such that first row alternates between pixels of color `<color1>` and `<color2>` with a period of `<height>`. For each row that follows, the period shall be `<height> - <row...
[Question] [ ## Intro So I've been wasting my time again researching suffix sorting algorithms, evaluating new ideas by hand and in code. But I always struggle to remember the type of my suffixes! Can you tell me which type my suffixes are? ## Left-most what? A lot of suffix sorting algorithms (SAIS, KA, my own daw...
[Question] [ So task is simple, given array of numbers and result, you need to find what operations you need to use on numbers from array , to obtain requested result. Let's make it simple for start, and allow only basic operations such as: addition, subtraction, multiplication and division. Example: ``` Input : ...
[Question] [ There is a virus inside a recipient of 5x5. As we know how it propagates its contamination, your mission is to output the last stage of the contamination. ### The recipient It will be representend as a two dimensional array of 5x5: ``` 0 0 0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 ``` Where `1` mea...
[Question] [ # The Task Write a function L() that takes two Tuple arguments of coordinates in the form (x, y), and returns their respective linear function in the form (a, c), where a is the co-efficent of the x term and c is the y-intercept. You can assume that the input will not be a line perpendicular the the x ...
[Question] [ **The golf challenge is to encode and compress the following image inside a source file.** ![Image](https://i.stack.imgur.com/XDpDu.png) To do this you need to write 3 functions: `red`, `green`, and `blue` which accept x/y coordinates of the image and return the corresponding R/G/B pixel value between ...
[Question] [ Katlani is a constructed language being designed in [chat](https://chat.stackexchange.com/rooms/133067/tnb-conlang-katlani). In this challenge, your goal is to print the largest dictionary of katlani nouns possible in 400 bytes or less. ## Task In 400 bytes or less, your program should print a list of ...
[Question] [ [![Tesco Burger Relish BBE: 20140](https://i.stack.imgur.com/meYNQ.png)](https://twitter.com/Tesco/status/1143449559722594306) Given a date between 2010-01-01 and 2099-12-31 as three integers (please state your order if not `[year,month,day]`), answer with Tesco's corresponding five-digit Burger Relish...
[Question] [ You will receive an integer less than 2000000000 and bigger than -2000000000 and you have to test what type(s) of number this is out of: ``` Factorial Square Cube Prime Composite Triangular Positive Negative ``` Here is a definition of all the different types of numbers: **Factorial** - A number That i...
[Question] [ *Disclaimer: Levenshtein coding is completely unrelated to the [Levenshtein edit distance metric](http://en.wikipedia.org/wiki/Levenshtein_distance).* <Insert long story about why Levenshtein codes need to be calculated here.> # The code [Levenshtein coding](http://en.wikipedia.org/wiki/Levenshtein_cod...
[Question] [ Write a program in a language with name `A` that, given a string `S`, outputs the name of a different programming language `B`. The length of `B` must be equal to the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) (abbr. "LD") between `A` and `S`. To be considered a programm...
[Question] [ > > ### Notice > > > This challenge has ended and will not be re-judged, but feel free to post answers and test your program against the others with the Control Program! > > > The aim of this challenge is to make an AI to win a fight against another AI by strategically drawing a wall on a 25x25 g...
[Question] [ Write an interactive program or function which allows the user to play The Coinflip Game! The object of the game is to repeatedly flip a coin until you get the same result \$n\$ times in a row. Specific behavior of the program/function is as follows: * At the start of the game, the user inputs a positi...
[Question] [ We have already defined a folding number [here](https://codegolf.stackexchange.com/questions/95458/folding-numbers). But now we are going to define a Super Folding Number. A Super Folding number is a number that if folded enough times it will eventually reach one less than a power of two. The method of...
[Question] [ In this quine variant, your program must output its source code transposed across the diagonal from the top left to the bottom right. For example: ``` your program on four lines ``` outputs ``` yof ono u u r r      p l r i o n g e r s a m ``` The whitespace in the output is not arbitrary. Sp...
[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 6 years ago....
[Question] [ My daughter had the following assignment for her math homework. Imagine six friends living on a line, named E, F, G, H, J and K. Their positions on the line are as indicated (not to scale) below: ![](https://i.stack.imgur.com/ECRsA.png) Thus, F lives five units from E, and two units from G, and so fort...
[Question] [ Inspired by the connection rules from [Calvin's Hobbies](https://codegolf.stackexchange.com/users/26997/calvins-hobbies)' question [Make me an alphabet tree](https://codegolf.stackexchange.com/questions/35862/make-me-an-alphabet-tree) take a number of lines of letters as input and output the number of ...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/1431/edit). Closed 3 years ago. [Improve this question](/posts/1431/edit) Fi...
[Question] [ This is a word puzzle. Your program should accept two words on the standard input. Word one is the start word. Word two is the end word. From the start word you have to reach the end word changing/add/remove one letter at a time. After each modification it must form a new valid word. Added letters ar...
[Question] [ The [keitai input method](https://en.wikipedia.org/wiki/Japanese_input_method#Keitai_input) is a method for writing Japanese kana on a 12-key phone keypad. Similar to Western keypads, each kana is assigned to a key; when the key is pressed multiple times, it cycles between all kana assigned to that key...
[Question] [ [The city defines a dog as any living entity with four legs and a tail.](https://www.getyarn.io/yarn-clip/f5ee7276-d66d-480a-862f-2f0dcfa5311e) So raccoons, bears, mountain lions, mice, [these are all just different sizes of dog.](https://www.danharmonsucks.com/shows/community/quotes/season-five/basic-...
[Question] [ **This question already has answers here**: [More Codington Crescent](/questions/211322/more-codington-crescent) (4 answers) Closed 3 years ago. *Let's just see how this goes* If you've ever listened to the radio program "I'm sorry, I haven't a clue", then you've probably heard of the game calle...
[Question] [ This question is a sequel to [this one](https://codegolf.stackexchange.com/questions/205214/remove-loops-from-a-walk), working in the opposite direction. For a reminder of terminology, the letters `L`, `R`, `U`, and `D` represent one-unit movement of a robot on the coordinate plane in the directions l...
[Question] [ Unlike most languages, Python evaluates `a<b<c` as it would be done in mathematics, actually comparing the three numbers, as opposed to comparing the boolean `a<b` to `c`. The correct way to write this in C (and many others) would be `a<b && b<c`. In this challenge, your task is to expand such comparis...
[Question] [ Remember that a set is unordered without duplicates. **Definition** An *N*-uniquely additive set *S* whose length is *K* is a set such that all *N*-length subsets in *S* sum to different numbers. In other words, the sums of all the *N*-length subsets of *S* are all distinct. **Objective** Given an arra...
[Question] [ This puzzle is the next in my series of Manufactoria challenges. # Background [Manufactoria](http://pleasingfungus.com/Manufactoria/) is a game / two-dimensional programming language. The player must create programs that will manipulate a queue to arrive at the desired output. It is easy to learn but h...
[Question] [ Create a function, expression, or program which does the following: 1. Take the prime factors of any number and sum them. For example, the prime factors of 28 are 2 2 7, summed to 11. 2. Multiply the result by the number of prime factors for the given number. E.g, 28 has 3 prime factors which sum to 11...
[Question] [ Given a non-empty list/vector of positive integers, write a function to check the following conditions in as few bytes as possible. 1. Take the first integer (the key, or k1) and check that the next k1 values have no duplicate values, excluding instances of k1. 2. Take the last integer (the second key,...
[Question] [ Given a date written in any (must handle all in the same program) of the following formats, parse it into a valid `yyyy/mm/dd date`. ``` 17th May 2012 March 14th, 2016 20 February 2014 September 14, 2017 Sunday, June 8, 2015 ``` **Rules** * Dates will sometimes be invalid, ie. incorrect day for the mon...
[Question] [ In [Bloons Tower Defense 6](https://btd6.com/), the strength of different bloons can be measured by their Red Bloon Equivalent (RBE), or the number of single pops it takes to completely defeat the bloon. The RBE for the bloon types are as follows (sourced from [the wiki](https://bloons.fandom.com/wiki/...
[Question] [ The Greatest Common Divisor, or **gcd**, of two positive integers \$x\$ and \$y\$ is the largest positive integer that divides both \$x\$ and \$y\$. The Least Common Multiple, or **lcm**, of two positive integers \$x\$ and \$y\$ is the smallest positive integer that is a multiple of \$x\$ and \$y\$. We...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/247241/edit). Closed 1 year ago. [Improve this question](/posts/247241/edit) ...
[Question] [ The sci-fi shooter Destiny 2 contains guns which have the ability to regenerate ammunition directly into the magazine **if, and only if** `x` (precision) shots are landed (in a fixed amount of time), returning `y` bullets to the magazine. For example, the perk (ability) "Triple Tap" will return 1 bulle...
[Question] [ ## Introduction: In my recent [*~~Strikethrough~~ the Word Search List* challenge](https://codegolf.stackexchange.com/questions/243844/s%cc%b6t%cc%b6r%cc%b6i%cc%b6k%cc%b6e%cc%b6t%cc%b6h%cc%b6r%cc%b6o%cc%b6u%cc%b6g%cc%b6h%cc%b6-the-word-search-list) I mentioned the following: > > When I do the word-sea...
[Question] [ I'm working on a golf for Java and I need an infinite loop. Obviously, I don't want to spend any more bytes than I have to, especially in such an expressive language. Assuming I have some code I want to run, obviously the baseline is set at `while(1>0)/*stmt*/` or 10 additional characters for a single ...
[Question] [ 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 have *m* torches with them, but each group needs at least one torch? **Example**: Three teens with tor...
[Question] [ Typically, when we want to represent a magnitude and direction in 2D space, we use a 2-axis vector. These axes are typically called X and Y: ![](https://i.stack.imgur.com/8ahzR.png) This isn't always convenient, however. The game BattleTech is played on a hexagonal grid, and it's convenient for the axe...
[Question] [ You are given a string of unknown length that contains a varied amount of `(`, `{`, `[` and their respective closing parentheses (in this context all referred to as *brackets*). With one exception, all the brackets are all balanced, meaning an opening one has a corresponding closing one somewhere after...
[Question] [ # NDos' Numeral System NDos' numeral system is a numeral system invented by me. It represents every nonnegative integer by a binary tree. Given a nonnegative integer \$n\$: * If \$n=0\$, it is represented as the empty tree. * Otherwise, the tree has a root. With the binary expansion of \$n\$: + The le...
[Question] [ Scala isn't a very commonly used language around here. Most of those who know it like it[citation needed], but some go `:\` when they encounter its user-defined operators, saying they're too complicated. However, they're governed by a very simple set of rules, outlined [here](https://docs.scala-lang.or...
[Question] [ *(Randomly inspired by <https://codegolf.meta.stackexchange.com/a/17272/42963>)* Given a rectangular matrix of digits (i.e., `0 - 9`), output the "pieces" of the matrix as if the digits are connected together forming a single piece, in ascending order by the digits. The pieces are guaranteed to connect...
[Question] [ ## Introduction: After I posted two rainbow-related challenges: *Codegolf Rainbow : Fun with Integer-Arrays* [1](https://codegolf.stackexchange.com/questions/170614/codegolf-rainbow-fun-with-integer-arrays) and *Codegolf Rainbow : Draw in Black-and-White* [2](https://codegolf.stackexchange.com/question...
[Question] [ A checkerboard program is a program where each individual character's ordinal value alternates from even to odd, excluding the line terminator (which can be any standard line-endings). A triangular program is a program where each line has one additional character than the preceding line, with the first...
[Question] [ Today's date is quite an interesting one. Let's take a look at why. The date `07/12/2017` (in `DD/MM/YYYY` date format) can be split into the year (`2017`) and the rest (`07/12`). You may notice that the digits in the year can be rearranged to match the digits in the rest of the date, which is the basi...
[Question] [ This is the Robber post. The [Cop post is here](https://codegolf.stackexchange.com/q/146926/31516). --- Your task is to take an integer input **N** and output the **Nth** digit in the sequence [OEIS A002942](http://oeis.org/A002942). The sequence consists of the square numbers written backwards: ``` 1,...
[Question] [ In [Keep Talking and Nobody Explodes](http://www.keeptalkinggame.com/), players are tasked with defusing bombs based on information from their "experts" (other people with a manual). Each bomb is made up of modules, one of which can be passwords, where the expert is given this list of possible password...
[Question] [ [Mancala](https://en.wikipedia.org/wiki/Mancala) is the name of a family of board games that usually involve a series of cups filled with beads that the players manipulate. This challenge will use a specific rule set for a solitaire variant of the game. The board consists of a "basket" at one end, foll...
[Question] [ (Hopefully it's still Thanksgiving for you) You got a turkey for your thanksgiving dinner but you don't know how to evenly distribute it. The problem is, some people eat more than others, so you need to find a solution ## Input There will be two inputs. The first will be an ascii art of various people....
[Question] [ Inspired by [Print the American Flag!](https://codegolf.stackexchange.com/questions/52615/print-the-american-flag) this is a direct copy but with the British flag as it has some symmetries but is still quite complex! Your challenge is to produce the following ASCII-Art in as few bytes as possible! Turn...