text stringlengths 180 608k |
|---|
[Question]
[
I spent all of today at a Super Smash Bros. tournament, and I started thinking about some of the terminology we use when describing sets. These are the three kinds of sets that I see played at tournaments:
* Best of 3 (Bo3)
+ Three games are played. The winner of the set is the player who won the majo... |
[Question]
[
# Introduction
I want to find the substring with the most `1`'s in a sequence of `0`'s and `1`'s.
# Input
Your program has two **inputs**, the sequence and the substring length.
The **sequence** is any number of `0`'s and `1`'s:
```
0100101010110111101110100101010001010110101010101010110110101001011011... |
[Question]
[
# Challenge description
Given a list / array of items, display all groups of consecutive repeating items.
# Input / output description
Your input is a list / array of items (you can assume all of them are of the same type). You don't need to support every type your language has, but is has to support a... |
[Question]
[
Create a function (or closest equivalent, or full program) that takes an list of some datatype (your choice) that may be nested and a string (in either order), and generalizes the lisp c[ad]+r functions.
>
> Functions are provided which perform compositions of up to four car and cdr operations. Their ... |
[Question]
[
# Sign that word 2!
Not that long ago, I posted a challenge called [Sign that word!](https://codegolf.stackexchange.com/questions/54945/sign-that-word). In the challenge, you must find the signature of word, which is the letters put in order (e.g. The signature of `this` is `hist`). Now then, that chal... |
[Question]
[
For this challenge, you will be required to write 3 programs:
1. The first program should be a [quine](https://codegolf.stackexchange.com/questions/69/golf-you-a-quine-for-great-good), i.e, it should print it's own source code.
2. The second program should read the input and print all of it.
3. The thi... |
[Question]
[
Your task is to take \$n \ge 2\$ points in 3D space, represented as 3 floating point values, and output the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance) between the two closest points. For example
$$A = (0, 0, 0) \\ B = (1, 1, 1) \\ C = (4, 0, 2)$$
would output \$\sqrt3 = 1.73... |
[Question]
[
Output/print this block of text:
```
1234567890
2468013579
3691470258
4815926037
5049382716
6172839405
7306295184
8520741963
9753108642
0987654321
```
Acceptable formats include:
* Trailing newlines/whitespace
* List of strings
* List of lists of characters
* List of lists of integers
However, list of ... |
[Question]
[
We haven't had a [string](/questions/tagged/string "show questions tagged 'string'") question for a while (5 days to be precise), so let's go for one.
Given a string `s` and a positive integer `n`, take every `n`th element of `s`, repeat it `n` times, and put it back into `s`.
For example, if `n = 3` a... |
[Question]
[
A polyglot is a program that runs in several languages.
Your challenge is to:
Choose at least two languages (Different versions count as different languages)
Create a program or function that takes several positive integers (one for each language you chose) and returns a program that:
Is a valid progra... |
[Question]
[
Oof! You've been coding the whole day and you even had no time for Stack Exchange!
Now, you just want to rest and answer some questions. You have ***T*** minutes of free time. You enter the site and see ***N*** new questions. To write an answer for each you'll need ***ti*** minutes. Of course, as a de... |
[Question]
[
In this challenge, we define the *complement* of a list of positive integers as all positive integers not included in that list. For example, the complement of the even numbers `[2, 4, 6, 8...]` is the odd numbers `[1, 3, 5, 7...]`. Your challenge is to, given a monotonically increasing, infinite list ... |
[Question]
[
Your task is, to count how many pluses I have.
## What Pluses?
* The no plus: 0 Points
```
-
```
* The naïve Plus: 1 Point
```
+
```
* The double Plus: 2 Points
```
+
+++
+
```
* The mega double plus: 3 Points
```
+
+++
+
+ + +
+++++++++
+ + +
+
+++
+
```
Pluses of higher ... |
[Question]
[
Your task is to, given two positive integers, \$x\$ and \$n\$, return the first \$x\$ numbers in the incremental ranges sequence.
The incremental range sequence first generates a range from one to \$n\$ inclusive. For example, if \$n\$ was \$3\$, it would generate the list \$[1,2,3]\$. It then repeated... |
[Question]
[
I have a list of decimal digits:
`4, 4, 4, 7, 7, 9, 9, 9, 9, 2, 2, 2, 4, 4`
The list of decimal digits are known as items. We can form "chunks" from these items by grouping together identical and adjacent numbers. I want to assign each chunk a unique number, starting from 1, and increasing by 1 in the ... |
[Question]
[
Create a function which takes a polynomial equation, a value for `x` and returns the result of the operation.
Example: given `4x^2+2x-5` and `x=3` output `37`. This is the result of `4(3)^2+2(3)-5`
* Assume all polynomials are valid
* Polynomial format will always be `coefficient(variable)^exponent => ... |
[Question]
[
So, you were sitting at your desk, golfing a program to calculate the first 20 digits of pi, and along comes your boss and throws your apple IIe out the window. You are now working on a new project and this computer does not yet have any text capability. None. No fonts. Nothing.
Now let's finish that p... |
[Question]
[
**This question already has answers here**:
[The rice and chess problem](/questions/79241/the-rice-and-chess-problem)
(40 answers)
Closed 5 years ago.
*Related: [Calculate Power Series Coefficients](https://codegolf.stackexchange.com/questions/105282/calculate-power-series-coefficients)*
Given a... |
[Question]
[
Given a number `n`, Output an ordered list of 1-based indices falling on either of the diagonals of an `n*n` square matrix.
## Example:
For an input of `3`:
The square shall be:
```
1 2 3
4 5 6
7 8 9
```
Now we select all the indices represented by `\`, `/` or `X` (`#` or non-diagonal positions are re... |
[Question]
[
## Challenge
Given an integer, \$s\$, as input where \$s\geq 1\$ output the value of \$\zeta(s)\$ (Where \$\zeta(x)\$ represents the [Riemann Zeta Function](https://en.wikipedia.org/wiki/Riemann_zeta_function)).
## Further information
\$\zeta(s)\$ is defined as:
$$\zeta(s) = \sum\limits^\infty\_{n=1}\f... |
[Question]
[
>
> ***Note**: [SmokeDetector](https://github.com/Charcoal-SE/SmokeDetector/blob/master/README.md) is a bot that detects spam and offensive posts on the network and posts alerts to chat.*
>
>
>
# What to implement
Smokey's `!!/alive` command uniformly at random picks one of these messages:
* Yup
* ... |
[Question]
[
I remember people saying that code size should be measured in bytes, and not in characters, because it's possible to store information with weird Unicode characters, which have no visual meaning.
How bad can it be?
In this challenge, you should output the following Lorem Ipsum text, taken from [Wikiped... |
[Question]
[
This is limited to Java and C# by the syntax I guess.
In this programming puzzle, you are to produce `Exception`s that can be caught but are thrown again at the end of the catch block.
```
try
{
while(true)
try
{
// you are only allowed to modify code between this try { ... |
[Question]
[
Create a function in your chosen language that prints out the following:
```
Old MacDonald had a farm, E-I-E-I-O,
And on that farm he had a cow, E-I-E-I-O,
With a moo moo here and a moo moo there,
Here a moo, there a moo, everywhere a moo moo,
Old MacDonald had a farm, E-I-E-I-O!
```
Where `cow` and `m... |
[Question]
[
Given a multidimensional, rectangular array of nonnegative integers, sort it at every depth (lexicographically), starting from the innermost.
For example, with this array:
```
[ [ [5, 1, 4],
[10, 7, 21] ],
[ [9, 20, 2],
[4, 2, 19] ] ]
```
You'd sort at the deepest first:
```
[ [ [1, 4, 5], ... |
[Question]
[
The Meeker numbers are a 7 digit number in form of \$abcdefg\$, where \$a×b=10c+d\$ and \$d×e=10f+g\$. As an example \$6742612\$ is a meeker number, here \$6×7=10×4+2\$ and \$2×6=10×1+2\$, so it is a meeker number.
Additionally, a Meeker number does not have any leading zeros (so \$a \ne 0\$)
## The Ch... |
[Question]
[
In Excel, the columns range from `A-Z, AA,AB,AZ,BA,..,BZ` and so on. They actually each stand for numbers, but rather are encoded as alphabet strings.
In this challenge, you will be given a string of alphabets, and you must calculate the column it corresponds to.
Some tests:
>
> 'A' returns 1 (meaning... |
[Question]
[
Given a positive integer `n` (***Example: `n=1234444999`***)
* Separate into consecutive digit runs:
+ `[1, 2, 3, 4444, 999]`
* Take the digital product of each run.
+ `[1, 2, 3, 4*4*4*4, 9*9*9] = [1, 2, 3, 256, 729]`
* Sum it...
+ 991
* Repeat until this converges to a single number:
+ 1234444999
... |
[Question]
[
## Task
Write a program that will take (as input) a positive integer. It will then count up from `0`, appending each integer to a `String`, only continuing if the length of the `String` is less than the value of the input.
A *serialized* integer is defined as the fully-formed integer with the maximum v... |
[Question]
[
Your challenge, should you chose to accept it, is to code-golf a function that returns true or false (or some similar meaningful representation of yes and no) if a number meets the following criteria:
1. The integer itself is a prime number OR
2. Either of its neighbor integers are prime
For example: ... |
[Question]
[
I think the Collatz Conjecture is already well-known. But what if we invert the rules?
Start with an integer n >= 1.
Repeat the following steps:
If n is **even**, multiply it by 3 and add 1.
If n is **odd**, subtract 1 and divide it by 2.
Stop when it reaches 0
Print the iterated numbers.
### Test case... |
[Question]
[
This is a [tips](/questions/tagged/tips "show questions tagged 'tips'") question for golfing in [python](/questions/tagged/python "show questions tagged 'python'").
In multiple golfs I've done in Python, a fixed value is assigned to one of two variables chosen by a Boolean. The chosen variable is overw... |
[Question]
[
Let's build a sequence of positive integers. The rule will be that the next number will be the smallest number which:
* It hasn't already appeared in the sequence
* Its absolute difference from the number preceding it wouldn't be equal to any previous absolute difference between consecutive elements.
#... |
[Question]
[
Part of [**Advent of Code Golf 2021**](https://codegolf.meta.stackexchange.com/q/24068/78410) event. See the linked meta post for details.
Related to [AoC2015 Day 10](https://adventofcode.com/2015/day/10).
*[Here's why I'm posting and not Bubbler](https://chat.stackexchange.com/transcript/240?m=5976519... |
[Question]
[
Given a permutation of the alphabet and an intended "word", determine if the word was guessed in a game of [Hangman](https://en.wikipedia.org/wiki/Hangman_(game)), where the permutation is the list of guesses.
For example, given `ASTNORDYUVKFMCLWIHEBQGPJXZ` as the permutation, and `ASTRONAUT` as the wo... |
[Question]
[
Imagine you have an array of integers, whose non-negative values are pointers to other positions in the same array, only that those values represent tunnels, so if the value in position A is positive and points to position B, then the value in position B must be also positive and point to position A to... |
[Question]
[
Now that we know how to properly [square](https://codegolf.stackexchange.com/questions/136564/square-a-number-my-way) and [triangle](https://codegolf.stackexchange.com/questions/137632/triangle-a-number) a number, we are going to learn how to parallelogram one. To parallelogram a number, we first arran... |
[Question]
[
You know what a *mono*tonic sequence is: each element is bigger than its predecessor (monotonically rising) or as its successor (monotonically falling).
*Bi*tonic means you have two arms of the sequence, one monotonically rising, the other falling.
For example, `1,3,5,7,6,4,2` is bitonic (rising until ... |
[Question]
[
Inspired by [this](https://mathematica.stackexchange.com/q/261869/71549) Mathematica.SE post
Given two positive integers \$n, k\$ with \$n > k \ge 1\$, output a binary \$n\times n\$ matrix such that every row and column contains exactly \$k\$ 1s, and the leading diagonal is all zero. This is the adjace... |
[Question]
[
## Challenge:
Given a positive integer, output the longest single-digit subsequence that occurs at least twice, AND has boundaries of another digit (or the start/end of the integer).
**An example:**
Input: `7888885466662716666`
The longest subsequence of a single digit would be `88888` (`7[88888]5466... |
[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 3 years ago.
[Improve this quest... |
[Question]
[
The **[Fibonacci polynomials](https://en.wikipedia.org/wiki/Fibonacci_polynomials)** are a polynomial sequence defined as:
* \$F\_0(x) = 0\$
* \$F\_1(x) = 1\$
* \$F\_n(x) = x F\_{n-1}(x) + F\_{n-2}(x)\$
The first few Fibonacci polynomials are:
* \$F\_0(x) = 0\$
* \$F\_1(x) = 1\$
* \$F\_2(x) = x\$
* \$F... |
[Question]
[
Let \$ A \$ represent the alphabet, such that \$ A\_1 = \$ `a` and \$ A\_{26} = \$ `z`.
Let's define that a word \$ W = w\_1 w\_2 ... w\_n \$ (where \$ w\_c \in A\$) is in **standard order** if and only if:
* \$ w\_1 = A\_1 \$, and
* for \$ 2 \le i \le n \$, if \$ w\_i = A\_x \$ then \$ w\_j = A\_{x-1}... |
[Question]
[
## Links
* [Chat room](https://chat.stackexchange.com/rooms/127801/nose-poker)
* [The official game report](https://ajfaraday.github.io/nose_poker/report.txt)
* [Github repo](https://github.com/AJFaraday/nose_poker) - In case of bugs to report
Here's the official score table:
```
<script src="https://a... |
[Question]
[
Generate the shortest possible code in any programming language that can generate all Pythagorean triples with all values not exceeding a given integer limit. A Pythagorean triple is a set of three integers \$(a, b, c)\$ that satisfy the equation \$a^2 + b^2 = c^2\$. The program should output the tripl... |
[Question]
[
We can arrange the positive integers like this:
```
1_| 2 | 5 | 10
4___3_| 6 | 11
9___8___7_| 12
16 15 14 13
```
That is, in L-shaped brackets expanding down and right infinitely.
Then, we can read it off with the antidiagonals:
```
1 2 5 10
/ / /
4 3 6 11
/ / /
9 8 7 12
/ / /
16 15 1... |
[Question]
[
A digit small number is a positive integer \$n\$ such for any two numbers that multiply to \$n\$, their total number of digits is more than the digits in \$n\$.
In otherwords: there are no two positive integers \$a\$ and \$b\$ such that:
\$
ab = n
\$
and
\$
\left\lfloor\log\_{10}(a)\right\rfloor+\left\... |
[Question]
[
>
> This is an answer-dependent challenge! The order of answers matters, and your exact task depends on the last answer that was posted. You might want to [sort the answers *by oldest*](https://codegolf.stackexchange.com/questions/44966/the-jigsaw-code-puzzle?answertab=oldest#tab-top).
>
>
>
Let's ... |
[Question]
[
Title says it all. Two input 32-bit positive integers `m, n >= 2`, output `gcd(m,n)` in prime factorization form.
## Input
Command line args or 1 line of stdin okay, whatever's better for golf.
## Output
Single space delimited with exponents (no additional spaces). Output nothing if the inputs are rela... |
[Question]
[
Given a list of positive integers, give the longest contiguous sublist which contains at most 1 pair of identical items. In the case of a tie return any of the solutions.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the goal is to minimize your source code wit... |
[Question]
[
**Background:**
For this challenge, a polynomial looks like this:
$$P(x)=a\_nx^n+a\_{n-1}x^{n-1}+\dots+a\_2x^2+a\_1x+a\_0$$
The degree, \$n\$, is the highest power \$x\$ is raised to. An example of a degree 7 polynomial would be:
$$P(x)=4x^7+2x^6-7x^4+x^2-6x+17$$
All powers are integers \$n\ge0\$. This... |
[Question]
[
In this challenge, bots must survive as long as possible. In each turn, the bot with the most HP is eliminated.
This challenge is inspired by the [Smallest unique number KoTH](https://codegolf.stackexchange.com/questions/172178/smallest-unique-number-koth).
### Results
After 100,000 rounds:
```
Jack: 6... |
[Question]
[
Instead of being a skillful warrior capable of slaying [Hydras](https://en.wikipedia.org/wiki/Lernaean_Hydra) (see [here](https://codegolf.stackexchange.com/questions/137980/become-the-hydra-slayer) and [here](https://codegolf.stackexchange.com/questions/138441/return-of-the-hydra-slayer)), this time y... |
[Question]
[
### The Task
Write a program or function that, when passed a numerical input `x`, prints or returns the primes beneath the square root of `x`1 that are not factors of `x`.
### Examples
Let `f(x)` be the function called:
```
>>> f(4)
[]
>>> f(5)
[2]
>>> f(20)
[3]
>>> f(60)
[7]
>>> f(100)
[3, 7]
>>> f(10... |
[Question]
[
A metaquine is a program which is not a quine, but whose output, when run as a program in the same language, is a quine.
The goal of this challenge is to write a metaquine. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code wins, with earliest answer ... |
[Question]
[
Today was [AP exam](https://en.wikipedia.org/wiki/Advanced_Placement_exams) registration day at my school, and while I was meticulously bubbling in the pages and pages of information required, the idea for this challenge hit me. So, given a string of letters and numbers, output an appropriately filled ... |
[Question]
[
What general tips do you have for golfing in Octave? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Octave (e.g. "remove comments" is not an answer). Please post one tip per answer.
[Answer]
1. Once you know, that `a` is free of ze... |
[Question]
[
The bots are looking for love. Can you help them?
## The rules
The goal of this game is find the bot you have the highest compatibility with. However, robots, who are inexperienced at dating are unable to tell how well a date went.
In the game, bots take turns "speed dating" some other bot. After each ... |
[Question]
[
**Motivation**: Sometimes certain items in a list don't count towards your totals. For example, counting plane passengers in rows, where babies sit on a parent's laps.
**Challenge**: write a program to split a list of items into chunks. Each chunk (except possibly the last) is the same *size*, where *s... |
[Question]
[
Your challenge is to write a program to print all the primes (separated by one or more whitespace characters) less than a given integer `N` with an asterisk (`*`) next to each twin prime. A [twin prime](https://en.wikipedia.org/wiki/Twin_prime) is a prime number that is either two more or two less than... |
[Question]
[
**This question already has answers here**:
[De-interleave log lines: HARD MODE](/questions/210051/de-interleave-log-lines-hard-mode)
(7 answers)
Closed 3 years ago.
You've inherited a server that runs several apps which all output to the same log.
Your task is to de-interleave the lines of the ... |
[Question]
[
This task is rather simple, and makes use of three distinct "operator" characters. Your task is, given a simple sequence of letters, perform the following task to encode it using `<`,`>`,`*`. You may choose to use either upper or lowercase letters, you do not have to handle both.
---
# Cipher Explanati... |
[Question]
[
**Minesweeper** is a logic game found on most OS's. The goal of the game is to determine where the mines are on a grid, given numbers indicating the number of mines around that spot.
Given a grid size, and a set of mines, generate the Minesweeper grid for that set of mines.
**Input:** Two integers indi... |
[Question]
[
## Introduction
The idea is to use the asterisk character (star) `*` to display an ascii-art star at a specified dimension. The dimension is an input number greater than or equal to \$1\$ that specifies the height in lines of the upper point of the star. The stars here are intended to be six pointed st... |
[Question]
[
Recently, my reputation was `25,121`. I noticed that each digit grouping (i.e. the numbers separated by commas) was a perfect square.
Your challenge is, given a non-negative integer **N** and a unary boolean [Black Box Function](https://codegolf.meta.stackexchange.com/a/13706/31957) *f* : **Z\*** → **B... |
[Question]
[
### Introduction
Let's observe the following array:
```
[1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1]
```
A **group** consists of the same digits next to each other. In the above array, there are 5 different groups:
```
[1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1]
1, 1, 1
2, 2
... |
[Question]
[
## Background
J has trains similar to [APL's](https://codegolf.stackexchange.com/q/150380/78410). Given a sequence of verbs (functions), three rightmost verbs are grouped to form a derived verb (a *fork*) recursively, until one or two verbs remain. If the sequence has odd length, the entire train is a ... |
[Question]
[
\$723 = 3 \times 241\$ is a semi-prime (the product of two primes) whose prime factors include all digits from \$1\$ to \$n\$, where \$n\$ is the total number of digits between them. Another way to look at this is that the (sorted) digits in the factorisation of \$723\$ are all consecutive. The first 1... |
[Question]
[
How, you can’t remember the 6 or 7-digit phone number that appeared on the TV screen for a second?! Using the special technique described below, you will turn into a walking phonebook!
Obviously, the number `402` is easier to remember than the number `110010010`, and the number `337377` is easier to re... |
[Question]
[
## Introduction *(may be ignored)*
Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all positive numbers. This is the fourth challenge in this series (links to the [first](https://codegol... |
[Question]
[
# Challenge
Factory workers are usually very hard-working. However, their work is now being commonly replaced with machines.
You have to write a program that takes a number as input. It will print out a factory of 10 workers 10 times. Every time, each worker has a `1/input` chance of being 'fired' and ... |
[Question]
[
## Introduction
The lexicographical permutations of a list with *n* elements can be numbered from 0 to *n*! - 1. For example, the 3! = 6 permutations of `(1,2,3)` would be `(1,2,3)`, `(1,3,2)`, `(2,1,3)`, `(2,3,1)`, `(3,1,2)`, `(3,2,1)`.
When a permutation is applied to a list, its elements are ordered... |
[Question]
[
Mr Jones wants to do a round-trip on his bicycle. He wants to visit several cities in arbitrary order, but his route must not cross it self, since he hates to be at the same place twice in his holidays. As he really loves cycling, the length of his route is completely irrelevant, but he dislikes to dri... |
[Question]
[
A long period prime is a prime number \$p\$ such that decimal expansion of \$1/p\$ has period of length \$(p-1)\$. Your task is to output this number sequence. For purposes of this challenge we will consider only odd primes.
[Period of a decimal expansion](https://en.wikipedia.org/wiki/Repeating_decima... |
[Question]
[
Related: [Landau's function](https://codegolf.stackexchange.com/q/191074/78410) ([OEIS A000793](https://oeis.org/A000793))
## Background
Landau's function \$g(n)\$ is defined as the largest order of permutation of \$n\$ elements, which is equal to \$\max(\operatorname{lcm}(a\_1,a\_2,\cdots,a\_i))\$ whe... |
[Question]
[
**Given a text input such as:**
```
THE QUICK
BROWN FOX
JUMPS OVER
THE LAZY
DOG
```
**render the following output:**
```
/\
\ \
/ \
/ /\/
/ / /\
... |
[Question]
[
# Background
You may be aware that periods in between letters in gmail addresses are ignored. Email sent to [[email protected]](/cdn-cgi/l/email-protection), [[email protected]](/cdn-cgi/l/email-protection), and [[email protected]](/cdn-cgi/l/email-protection) all end up in the same place!
This is a gr... |
[Question]
[
## Background (skip to definitions)
Euler proved a beautiful theorem about the complex numbers: \$e^{ix} = \cos(x) + i \sin(x)\$.
This makes de Moivre's theorem easy to prove:
$$
(e^{ix})^n = e^{i(nx)} \\
(\cos(x) + i\sin(x))^n = \cos(nx) + i\sin(nx)
$$
We can plot complex numbers using the two-dimensi... |
[Question]
[
In this challenge, you will play the iterated Prisoner's Dilemma, but with a twist: There's also an adversary trying to mess you up!
The [Prisoner's dilemma](https://en.wikipedia.org/wiki/Prisoner%27s_dilemma) is a scenario in game theory where there are two players, who we'll call the "prisoners", eac... |
[Question]
[
Your task is to take as input a single string (or list of characters, list of code points, etc.) and return the length of the longest substring with no character appearing more than once.
**Aside:** This challenge is similar to [Longest Non-Repeating Substring](https://codegolf.stackexchange.com/q/1543... |
[Question]
[
This challenge is inspired by a series of young children's books by Fiona Watt and Rachel Wells, which I've recently been enjoying with my daughter.
In each book a mouse (illustrated, but not part of the text) complains that a succession of 5 things of the same type are not its thing. It then backs th... |
[Question]
[
**This question already has answers here**:
[Distribute a number into a list of values as equal as possible whose sum is equal to that number](/questions/132101/distribute-a-number-into-a-list-of-values-as-equal-as-possible-whose-sum-is-equa)
(23 answers)
Closed 4 years ago.
There is a job which... |
[Question]
[
We have a square 10x10 meter garden outside our house. We want to plant grass and make a terrace. We have decided *how* to divide the garden, but we haven't decided the ratio between amount of grass vs terrace.
We need help visualizing it, and ASCII-art is clearly the best way to do so.
---
### Challen... |
[Question]
[
*This challenge is essentially identical to [this one](https://codegolf.stackexchange.com/q/131852/3527) with just one difference: it is now allowed to shuffle letters anywhere in the string.*
## Scenario
John has an important number, and he doesn't want others to see it.
He decided to encrypt the numb... |
[Question]
[
The naming conventions for games in the Super Mario series is very strange, and don't match up between regions.
```
| Japanese Name | American Name |
|---------------------|------------------------------------|
| Super Mario Bros. | Super Mario Bros. |
| Su... |
[Question]
[
# Kuznetsov's Sequence
```
(I made the name up, don't bother with Wikipedia or Google)
```
Given any number `n > 0`, let `r` represent the reverse of the number `n`. Iterate until the final result is zero, passing the result of each iteration back into the function using recursion or a methodology of y... |
[Question]
[
Generate the *n*th [Narayana-Zidek-Capell](https://oeis.org/A002083) number given an input *n*. Fewest bytes win.
f(1)=1, f(n) is the sum of the previous floor(n/2) Narayana-Zidek-Capell terms.
Test Cases:
```
f(1)=1
f(9)=42
f(14)=1308
f(15)=2605
f(23)=664299
```
[Answer]
# Jelly, ~~11~~ 10 bytes
... |
[Question]
[
**Proto space invaders**
This is a graphical output challenge where the task is to give the shortest code per language.
**Task**
Your code should allow the user to move the following alien around the screen/window.
[](https://i.stack.... |
[Question]
[
Different systems have different ways to describe colors, even if all of them are speaking in R-G-B-A space. A front-end developer who is familiar with CSS may prefer `#RRGGBBAA`. But Android developers may prefer `#AARRGGBB`. When handling AAS file format, `#AABBGGRR` is needed. That's too confusing. ... |
[Question]
[
**This question already has answers here**:
[Run Length Decoding](/questions/12902/run-length-decoding)
(51 answers)
Closed 7 years ago.
Working with old files from DOS, I found an ancient text animation format, that specify how much time each frame must be shown in the screen. It's very simple:... |
[Question]
[
There's the classic run length encoding and decoding.
```
input output
a3b2c5 aaabbccccc
```
And that's fairly straight forward and done before.
The challenge is to also account for a non-standard behavior when multiple characters precede the run length (a ***single*** digit from 0-9). Each characte... |
[Question]
[
What general tips do you have for golfing in Whitespace? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Whitespace (e.g. "remove comments" is not an answer).
Please post one tip per answer.
[Answer]
I'm not entirely sure whether th... |
[Question]
[
## Background
We define a **circular step sequence** of order \$n\$ as follows:
$$
a\_1, a\_2, \dots, a\_n = \text{Permutation of } 1 \dots n \\
b\_i = \min ( |a\_{i+1} - a\_i|, n-|a\_{i+1} - a\_i| ), 1 \le i < n \\
\text{Circular step sequence} \stackrel{\text{def}}{=} b\_1, b\_2, \dots, b\_{n-1}
$$
I... |
[Question]
[
Output the following result (which is a result of calculating 6 \* 9 in bases from 2 to 36). Make sure letters are uppercase, and the multiplication itself is outputed on every line.
```
6 * 9 = 110110
6 * 9 = 2000
6 * 9 = 312
6 * 9 = 204
6 * 9 = 130
6 * 9 = 105
6 * 9 = 66
6 * 9 = 60
6 * 9 = 54
6 * 9 =... |
[Question]
[
*Inspired by [this video](https://www.youtube.com/watch?v=wdgULBpRoXk) by Ben Eater. This challenge forms a pair with [Decode USB packets](https://codegolf.stackexchange.com/q/229375).*
The USB 2.0 protocol uses, at a low level, a line code called [**non-return-to-zero**](https://en.wikipedia.org/wiki/... |
[Question]
[
She said **s(he) be(lie)ve(d)**, he said **sbeve**.
**Input**
* A non-empty string, `s`. It's guaranteed that `s` will have only printable ASCII characters and at least one word (defined as `[A-Za-z0-9]+`) in parentheses, and all parentheses will be closed respectively.
**Output**
* A string containing... |
[Question]
[
[Related, but this only requires positive integers and does not have to be commutative](https://codegolf.stackexchange.com/q/8892/59487)
The Cantor Pairing Function is described in [this Wikipedia article](https://en.wikipedia.org/wiki/Pairing_function). Essentially, it is an operation such that when i... |
[Question]
[
Given an integer \$ n \$ \$ (n \ge 1) \$, return/output the total number of set bits between \$ 1 \$ and \$ n \$ inclusive. To make the problem more interesting, **your solution must run with a time complexity of** \$ \mathcal{O}((\log n)^k) \$ **or better, for some constant** \$ k \$ **(AKA poly-logar... |
[Question]
[
A Russian nesting doll, more commonly known as a [Matryoshka doll](https://en.wikipedia.org/wiki/Matryoshka_doll), is a doll which contains a smaller version of itself, which then contains another smaller version of itself, which contains a smaller version of itself, which contains a smaller version o... |
[Question]
[
## Input:
We take two inputs:
* An input `b` with two distinct values: `Left` and `Right`.*†*
* And a positive integer `n`.
## Output:
Based on the Left/Right input, we output either of the following two sequences in the range of `1-n` (in the sequences below the first 125 items are displayed):
```
Lef... |
Subsets and Splits
Python Q&A Count
Counts the number of questions and answers related to Python in the dataset, providing insight into the prevalence of Python content.