text stringlengths 180 608k |
|---|
[Question]
[
## The task
Most Casio calculators featured a variable `M`, which has 3 operators related to it: `M`, `M+`, and `M-`
`M`, as you can expect, returns the value stored in the variable.
`M+` takes the number on the left and add it to `M`.
`M-` does the same thing as `M+`, but subtract instead.
To make the... |
[Question]
[
In 1988, the International Mathematical Olympiad (IMO) featured this as its final question, Question Six:
>
> Let \$a\$ and \$b\$ be positive integers such that \$ab + 1\$ divides \$a^2 + b^2\$. Show that \$\frac{a^2 + b^2}{ab + 1}\$ is the square of an integer.
>
>
>
([IMO problems](https://www.im... |
[Question]
[
[Related challenge](https://codegolf.stackexchange.com/questions/243441/bandwidth-of-a-matrix)
A [band matrix](https://en.wikipedia.org/wiki/Band_matrix) is a matrix whose non-zero entries fall within a diagonal *band*, consisting of the main diagonal and zero or more diagonals on either side of it. (T... |
[Question]
[
The brilliant engineers at <enter company you love to hate> have struck again. This time they've "revolutionised" the generation of random permutations. "Every great invention is simple" they say and their magical new algorithm is as follows:
* Start with a list `1,2,3,...,n` of numbers to permute.
* F... |
[Question]
[
You are a historian studying a long forgotten language. You have just discovered a clay tablet which seems to list all known words in the language, in alphabetical order. Your task is to find this alphabet's order, if it exists.
## The Task
Given an ordered list of words, try to output an ordered list ... |
[Question]
[
The *ball game* is a game in which a number of players sit together in a circle. Each player is first assigned a number \$ n \$, either `1`, `2`, or `3`. The game begins with any starting player, and proceeds *clockwise* around the circle. The *current* player with the ball throws it to the *next* play... |
[Question]
[
# Challenge:
Read input (within visible ASCII range) and output with a few modifications:
1. In each set of 10 characters of the input randomly (50/50):
* replace one character\* (with a random\*\* one within visible ASCII range) (ex. `lumberjack` becomes `lumbeZjack`)
* or remove one character (ex.... |
[Question]
[
*Inspired by [this](http://www.bradyharanblog.com/blog/2016/3/30/math-in-the-archives) Numberphile entry*
## Background
The ***cube distance numbers*** of an integer *n* are defined here as the set of integers that are *x³* distance away for a given *x*. For a simple example, with `n=100` and `x=2`, th... |
[Question]
[
Your task is to find the length of the coastline of a map of islands provided in
an ASCII map. The input map will consist of 1 or more `#` characters that
indicate land, and spaces which indicate water. The coastline is considered to
be any edge between land and water, including inland lakes and island... |
[Question]
[
# Confidant Numbers
Let `x` be an integer of an arbitrary base, such that `D` is an array of its digits. `x` is a Confidant Number if, for all `n` between `1` and the length of `D`:
```
D[n+1] = D[n] + D[n-1] + ... + D[1] + n
```
---
Take, for example, the number `349` in base 10. If we label the indic... |
[Question]
[
When students are first taught about the [proof](http://en.wikipedia.org/wiki/Mathematical_proof) technique of [mathematical induction](http://en.wikipedia.org/wiki/Mathematical_induction), a common example is the problem of tiling a 2N×2N grid with L-shaped [trominoes](http://en.wikipedia.org/wiki/Tro... |
[Question]
[
Given a sequence of numbers, find the minimum number of jumps to go from the starting position to the end and come back to the starting position again.
Each element of the sequence denotes the maximum number of moves that one can move from that position.
At any position, you can make a jump of at max k... |
[Question]
[
[This anecdote](http://thedailywtf.com/Articles/Cheaters-Never-Prosper.aspx) contains the following intriguing exchange:
>
> "Fine, Fred," Avi interrupted. "Then how would you change this to
> avoid duplicate entries?"
>
>
> "Oh, just change that one there to a negative one."
>
>
>
While this c... |
[Question]
[
Output "Mozart - Alla Turca" to stdout (see the sample for "reference implementation")
Try to find how to pack both synthesizer and the music into minimal size.
Requirements:
* Format suitable for feeding into `aplay -f cd` (signed 16-bit little endian, 2 channels);
* Entire music should be played (no ... |
[Question]
[
I thought it'd be interesting to turn [AoC day 3](https://adventofcode.com/2020/day/3) puzzle into a Golfing Challenge, so here it is.
### Task
Find the number of `#` you'd encounter in an 11x11 grid (consisting of `#` and `.`) that repeats itself (to the right side), starting at the top left corner, w... |
[Question]
[
### Definition
We say a pair of integers \$(a,b)\$, where \$0<a<b<N\$ and \$N\$ is an integer larger than 4, is an inverse neighbor pair respect to \$N\$ if \$ab\equiv1\text{ }(\text{mod }N)\$ and \$1\le b-a\le\log\_2{N}\$. There may be no such pairs respect to some integers \$N\$.
To illustrate the de... |
[Question]
[
I have so many secrets and nowhere to keep them!
The goal is simple: write a program that lets you save a string and have it be protected by a password.
The program will take an alias, password and (optional) secret as parameters.
If this is the first time the program is called with a given alias, then... |
[Question]
[
Look at the following string. Notice a pattern?
```
ABEFNOPEFGH
DC G Q I
M H R J
LKJI S K
D T L
C U M
BAZYXWV N
E O
D P
C Q
BAZYXWVUTSR
```
As some might have noticed, it's basically a spiral of the alphabet, where the distances between rows / columns are... |
[Question]
[
Inclusion-Exclusion lets you calculate the sizes of some unions and intersections between sets knowing some of the other values. I won't explain it exactly, but your challenge is to visualize inclusion-exclusion on a Venn Diagram.
Because I'm nice, you'll be using rectangles, not circles.
You will be g... |
[Question]
[
Given a matrix, sum its values up/down or left/right to form an X, fold it up, and return the list. I describe the algorithm here:
# Algorithm
Your input will be a odd-sized square matrix of integers within your language's reasonable numerical capacity.
Let's take the following matrix as an example:
``... |
[Question]
[
Many of us are familiar with the game Tron. You control a "lightcycle" placed on a grid. The lightcycle always moves forward (though you control the direction) and leaves a permanent trail behind it. If you run into a trail, you crash!
The goal here is to determine if a given path is a valid loop, that... |
[Question]
[
The keyboard layout people commonly use is the **QWERTY** layout as shown below.
[](https://upload.wikimedia.org/wikipedia/commons/thumb/d/da/KB_United_States.svg/1000px-KB_... |
[Question]
[
# The 3x3 Hexa Prime Square Puzzle
### Introduction
We consider 3x3 squares of hexadecimal digits (from `0` to `F`) such as:
```
2 E 3 1 F 3
8 1 5 7 2 7
D D 5 B B 9
```
We define a **3x3 Hexa Prime Square** (**HPS3**) as such a square for which all hexadecimal numbers read from left to right a... |
[Question]
[
Given (on STDIN, as command line arguments, or as function arguments) two distinct non-empty strings, find and return the shortest substring of the first string which is not a substring of the second. If no such substring exists, you may return the empty string, return any string which isn't a substrin... |
[Question]
[
You should write a program or function which receives a string representing an ASCII art as input and outputs or returns the number of endpoints in the input.
The input will consist of the characters `space - | +` (with 0, 2, 2 and 4 endpoints respectively) and linebreaks. E.g.:
```
-|++-
+
```
Two a... |
[Question]
[
>
> *This challenge is **not** code golf. Please read the scoring before you attempt to submit an answer.*
>
>
>
You will be given a multi-line string as input. You should output the *size of the largest contiguous chunk* of non-space characters. Contiguous just means that the chunk is a single pie... |
[Question]
[
Following the theme of [strange kitchen appliances](https://codegolf.stackexchange.com/questions/218360/what-temperature-is-my-stove), let's talk about my microwave.
# Introduction
My microwave has a keypad that is laid out like this:
```
30 > 15
1 2 3
4 5 6
7 8 9
+/- 0 S/M
```
* I can pr... |
[Question]
[
# Input
4 integers w, x, y, z from the range -999 to 999 inclusive where none of the values is 0.
# Output
4 integers a, b, c, d so that a*w + b*x + c*y + d*z == 0 where none of the values is 0.
# Restrictions
Your output should be the solution with the smallest sum of absolute values possible. That is... |
[Question]
[
The challenge is to golf a program that checks if a statement of propositional calculus/logic is a [logical tautology](https://en.wikipedia.org/wiki/Tautology_(logic)) (i.e. it is true for all possible values of the variables).
## Input
Input formulas will use `P`, `P'`, `P''` ect. as variables. They c... |
[Question]
[
As the title -- although discretely -- hints, I only pay with dollars.
## The challenge
Write a function/program that takes a string as input, which is a monetary value preceded by a symbol. `ex) £4.99`. Then, return that same amount converted to USD.
## Input
You will get a string as input. It will h... |
[Question]
[
Your challenge is to write 5 different full programs for the 5 following tasks:
1. Print `Hello, World!`.
2. Given an input on STDIN, output the factorial (you can assume that the input is an integer ≥ 0).
3. Given an integer N, calculate the sum of the primes ≤ N.
4. Given an input on STDIN, output th... |
[Question]
[
## Leaderboard
```
User Language Score
=========================================
Ell C++11 293,619,555
feersum C++11 100,993,667
Ell C++11 78,824,732
Geobits Java 27,817,255
Ell Python ... |
[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/28714/edit).
Closed last month.
[Improve this question](/posts/28714/edit)
M... |
[Question]
[
This is a basic version of the rather more difficult [Drawing 3d nets - Archimedean solids](https://codegolf.stackexchange.com/questions/10660/drawing-3d-nets-archimedean-solids) .
I have a weakness for 3d nets which when cut out and folded allow you to make 3d shapes out of paper or card. The task is ... |
[Question]
[
You are given a [Bingo](http://en.wikipedia.org/wiki/Bingo_%28U.S.%29) board and a list of calls. You must print BINGO! as soon as your board wins the game.
Bingo boards look like this:

They will be specified like this:
```
14 29 38 ... |
[Question]
[
This is a math problem which takes quite many things into question, making it rather challenging, and as you might have guessed, it's a code golf, so it should be as short as possible as well.
The **input**, \$n\$, is any *integer* number (should at least support integers, but needn't be limited to). T... |
[Question]
[
How many ways can one place (unlabelled) dominoes on a square chequerboard such that the number placed horizontally is equal to the number placed vertically?
The dominoes must align with, and may not protrude, the chequerboard and may not overlap.
This is OEIS sequence [A330658](https://oeis.org/A33065... |
[Question]
[
The [**variable star designation**](https://en.wikipedia.org/wiki/Variable_star_designation) is an identifier for a variable star (a star that fluctuates in brightness). It consists of either a 1-2 letter code or (when the letter code is no longer sufficient) a 'V' followed by a number. This code is fo... |
[Question]
[
You want to find the length shortest path between two points, on an 2d ASCII "map". The roads are made up of `+` characters, and the two endpoints are represented by `#`s (not counted in the length). This road can be arranged in any way, and any other characters can be ignored. You can assume the endpo... |
[Question]
[
The positive rational numbers can be shown to be numerable with the following process:
1. Zero has the ordinal 0
2. Arrange the other numbers in a grid so that row a, column b contains a/b
3. Plot a diagonal zig-zag top right to bottom left
4. Keep a running tally of the unique numbers encountered alon... |
[Question]
[
Your task is to write a computer program such that when it is cut up into lines (split on the newline character) every arrangement of the lines will output a different number between **1** and **n!** (where **n** is the total number of lines). No number should be output by two different arrangements an... |
[Question]
[
Given two *different* lists of non-negative integers, return the list that has the highest maximum (e.g. `[4, 2], [3, 3, 1] -> [4, 2]`).
If they both have the same maximum, return the list that contains more instances of this maximum (e.g. `[4, 2, 4], [4, 3, 3, 3, 1, 3] -> [4, 2, 4]`).
If, after these ... |
[Question]
[
For another challenge I am writing, I need to verify that test cases are solveable with bounded integers. Specifically, I need to verify the following, for a non-empty array of integers `A` and an integer bit width `n`:
1. All integers `a` in `A` satisfy `-2**(n-1) <= a < 2**(n-1)` (representable with ... |
[Question]
[
We have objects that oscillate between two integer points, `[l, r]`, at the speed of one unit per time unit, starting at `l` on `t=0`. You may assume `l < r`. For example, if an object oscillates on `[3, 6]`, then we have:
```
t=0 -> 3
t=1 -> 4
t=2 -> 5
t=3 -> 6
t=4 -> 5
t=6 -> 4
t=7 -> 3
t=8 -> 4
```
... |
[Question]
[
Anyone here a die-hard Bethesda fan? Maybe you prefer Obsidian Entertainment? Well, if you're either of those things than the following picture should be relatively familiar to you.
[](https://i.stack.imgur.com/rn77P.jpg)
I've taken the liber... |
[Question]
[
## Rules
1. No cell range references (`A2:B3`).
2. Maximum 9 rows and 9 columns.
3. No circular references or formula errors.
4. Empty cells evaluate to `0`.
5. Data are numbers only, but may be taken as strings.
6. Formulas are strings.
## Implementation choices
You must state your choices in these ma... |
[Question]
[
This challenge is inspired by [Mathematics is fact. Programming is not](https://codegolf.stackexchange.com/questions/109248/mathematics-is-fact-programming-is-not).
---
The mathematical notation for a factorial, or a **fact** is an exclamation mark **`!`**. The exclamation mark is also a common symbol ... |
[Question]
[
Because of this, families from all over the world are building Christmas trees.
But this normal tree can get boring after a while, so let's make an ASCII tree!
Leafs are represented by `#` and must be arranged as shown in the example output. We have 5 balls (`O`) and 5 candy canes (`J`), which we place... |
[Question]
[
Palindromic prime problems are pretty common, but that's not what this question is about. In this challenge, the number doesn't have to be a palindrome, its prime factors do.
# Task
Your code has to take a single positive integer as input. Then check if any of the permutations of the prime factors of t... |
[Question]
[
The aim is simple: given the string of resistance values, draw the part of "electrical circuit" of those resistors. Examples follow.
1. Input: `3`. Output:
```
--3--
```
2. Input: `1,2,3`. Output:
```
--1----2----3--
```
Next, the resistors can be joined parallel (by 2 or 3 resistors per join), but the... |
[Question]
[
You have a number of polynomials who are lonely, so make them some companions (who won’t threaten to stab)!
For a polynomial of degree `n`, there is an `n by n` companion cube [matrix](https://en.wikipedia.org/wiki/Companion_matrix) for it. You need to make a function that accepts a list of coefficient... |
[Question]
[
Clem is a minimal stack-based programming language featuring first-class functions. Your objective is to write an interpreter for the Clem language. It should properly execute all examples included in the reference implementation, which is available [here](http://www.orbitaldecay.com/code/clem.zip).
* ... |
[Question]
[
Golfers.
Together, we have banded together to produce code that is concise, is functionally beautiful and is uglier then the Phantom of the Opera from the original novel.
The time has come for us to bring beauty back to the world of programming. With color. In a way that is concise, functionally beauti... |
[Question]
[
[Manchester coding](http://en.wikipedia.org/wiki/Manchester_code) is a telecom protocol used in radio communications that guarantees bit transitions at a regular interval so a receiver can recover the clock rate from the data itself. It doubles the bitrate, but is cheap and simple to implement. It is w... |
[Question]
[
In Haskell (and probably some other languages or something) `zip` is a function which takes two lists, and produces a list of tuples by pairing elements at the same index:
```
zip [1,2,3] [6,5,4] = [(1,6),(2,5),(3,4)]
```
If there are extra elements on one of the input lists those are trimmed off and d... |
[Question]
[
Part of [**Code Golf Advent Calendar 2022**](https://codegolf.meta.stackexchange.com/questions/25251/announcing-code-golf-advent-calendar-2022-event-challenge-sandbox) event. See the linked meta post for details.
---
*Inspired by <https://xkcd.com/835>*
In the midst of his mid-life crisis, Santa has im... |
[Question]
[
You have a line with two endpoints `a` and `b` (`0 ≤ a < b`) on a 1D space. When `a` or `b` has a fractional value, you want to round it to an integer.
One way to do this is to round `a` and `b` each to its nearest integer, but this has a problem that the length of the rounded range (`L`) can vary whil... |
[Question]
[
The Caesar cipher is a simple and famous cipher, where the letters of the alphabet are rotated by some secret amount. For example, if our secret rotation is `3`, we would replace `a` with `d`, `b` with `e`, `w` with `z`, `x` with `a` and so on.
Here is an example (rotation amount: 10):
```
Robo sc kx o... |
[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 [AoC2018 Day 8](https://adventofcode.com/2018/day/8).
---
The license file for an imaginary software system is defined as follows:
* The entire file is a... |
[Question]
[
Output a sequence of all the primes that are of the following form:
`123...91011...(n-1)n(n-1)..11109...321`. That is, ascending decimal numbers up to some `n`, followed by a descending tail, all concatenated.
## Background
Recently, Numberphile [posted a video](https://www.youtube.com/watch?v=vKlVNFOH... |
[Question]
[
## Background
Zeckendorf representation is a numeral system where each digit has the value of Fibonacci numbers (1, 2, 3, 5, 8, 13, ...) and no two consecutive digits can be 1.
[Nega-Zeckendorf representation](https://en.wikipedia.org/wiki/Zeckendorf%27s_theorem#Representation_with_negafibonacci_number... |
[Question]
[
[Try it online!](https://tio.run/#) currently has 680 listed languages, all of which are searchable. For most of those languages, when searching for it, you don't have to enter the entire string. For example, entering `lega` results in just [05AB1E (legacy)](https://tio.run/#05ab1e) appearing, and ente... |
[Question]
[
Input
```
_ _ _ _ _ _ _ _
| _| _||_||_ |_ ||_||_|| |
||_ _| | _||_| ||_| _||_|
```
output
```
1234567890
```
**Rules**
Code golf - shortest code wins.
Input will be given as a 3-line string with each line separated by a newline, or as 3 separate strings. Each line is guaranteed ... |
[Question]
[
Imagine we have some [polyomino](https://en.wikipedia.org/wiki/Polyomino) and would like to uniquely identify them, however the polyominos can be rotated, so blindly hashing them won't give us the same fingerprint for a piece and a rotation thereof (in general).
For example if we have the L-tetromino
`... |
[Question]
[
There are some iron particles on a board. We pass a current carrying wire through that board and the particles form circles. Show these circles if input given is the position of the wire.
Consider the board to be a grid of size 7x7 (fixed)
No extra white spaces are allowed.
Input can be 0-indexed or 1-... |
[Question]
[
How can I shorten:
```
p=gets.to_i
a=gets
b=gets.to_i
```
If my input is an integer, followed by a string, followed by an integer?
[Answer]
## Use ARGV ($\*) and mass assignment
*(disclaimer: I don't know Ruby, but this works [on TIO](https://tio.run/##KypNqvz/v0AnUSfJVkWLq8C2QK8kPz6TK8k2CcIoKC0pV... |
[Question]
[
>
> Inspired by [this chat message](https://chat.stackexchange.com/transcript/message/40172973#40172973)
>
>
>
Your task will be to take a word and find the average position of its letters on the keyboard as a letter.
## Keyboard Layout
Since layouts vary from keyboard to keyboard, we will be using... |
[Question]
[
# Task
You will be given a positive integer and you must output a "[self-complementary graph](https://en.wikipedia.org/wiki/Self-complementary_graph)" with that many nodes. If you don't know what a self-complementary graph is the wikipedia article wont help you much so below are two explanations, a tec... |
[Question]
[
Now, we all know most languages have very simple ways to "self-modify" code.
However, what if you were to actually modify the code and edit parts of it...on disk?
Your goal is to make code that prints a number, then edits its own file to replace the number with the next one in the Fibonacci sequence l... |
[Question]
[
This challenge is simple. Given a number, output a ascii-art representation of the number, using the Mayan Base-20 numeral system.
### What is the Mayan system?
The Mayans used base 20 to store numbers, so the first position was the `1`s place, the next the `20`s place, then the `400`s, etc.
So Mayan n... |
[Question]
[
This [Stack Snippet](http://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets/) draws an [aliased](http://en.wikipedia.org/wiki/Aliasing) white rectangle on a black background given parameters for its dimensions, position, angle, and the grid dimensions:
```
<sty... |
[Question]
[
Write a named function or program that accepts a single integer N and prints (to STDOUT) or returns (as a string) the first N bars of the spiral below, beginning with the vertical bar in the center and spiraling clockwise outward.
```
_______________
/ _____________ \
/ / _________... |
[Question]
[
You are given a list of (*a,b*), and a list of *x*. Compute the maximum *ax+b* for each *x*. You can assume *a*, *b* and *x* are non-negative integers.
Your program or function must run in expected (to the randomness if your code involves that, not the input) **O(*n*log*n*) time** where *n* is the tota... |
[Question]
[
[Graham's number](http://en.wikipedia.org/wiki/Graham%27s_number) ends in a 7. It is a massive number, in theory requiring more information to store than the size of the universe itself. However it is possible to calculate the last few digits of Graham's number.
The last few digits are:
```
02425950695... |
[Question]
[
### Background
The look-and-say sequence begins with \$1\$, each following term is generated by looking at the previous and reading each group of the same digit (eg. \$111\$ is three ones, so \$111 \rightarrow 31\$). The first few terms are
$$ 1, 11, 21, 1211, 111221, 312211, \dots $$
Conway's cosmolog... |
[Question]
[
The challenge is to write a program which will find the shortest (least number of characters) command which will navigate to a target directory, given a starting directory, assuming a standard linux file system.
Take the following file system as an example, starting from `~`:
```
.
├── target
└── test
... |
[Question]
[
Your challenge, should you choose to accept it, is to take as input:
1. A program in DirectionLang (as an ASCII string consisting of DirectionLang instructions)
2. A list of pairs of integers, henceforth known as the pretty places. This list may be taken in any reasonable format.
You should then output... |
[Question]
[
Please help me automate my discrete mathematics homework. Given a valid propositional formula, check if it is an instance of one of Łukasiewicz's axioms. Here's how it works.
A *term* can be defined inductively as follows:
* Single lower-case letters of the Latin alphabet (`a`, `b`, `c`, etcetera) are ... |
[Question]
[
Wholly surprised this hasn't been posted already, given the large number of chess puzzles on the site. While I thought of this myself, credit to Anush for [posting it to the sandbox back in March](https://codegolf.meta.stackexchange.com/a/17463/70388). But I figured it's been long enough that I could g... |
[Question]
[
### Challenge
Given a non-negative integer, output whether it is possible for two dates (of the Gregorian calendar) differing by exactly that many years to share a day of the week. A year is assumed to be a leap year either if it is divisible by 4 but not by 100, or if it is divisible by 400.
Output ma... |
[Question]
[
Take three inputs, a string of text, `T`; a string of characters to replace, `F`; and a string of characters to replace them with, `R`. For each substring of `T` with the same (case insensitive) characters as `F`, replace them with the characters in `R`. However, keep the same case as the original text... |
[Question]
[
>
> *If you are not familiar with Braid-Theory I recommend that you read [this](https://en.wikipedia.org/wiki/Braid_group#Basic_properties) first. This question assumes that you are at least familiar with the concepts at hand and assumes you are well familiar with group-theory*
>
>
>
Let us define ... |
[Question]
[
Given a positive integer ***n ≤ 500***:
* Find the *smallest* positive integer ***k*** such that all digits in the decimal representation of ***n\*k*** are either ***0*** or ***d***, with ***1 ≤ d ≤ 9***.
* Print or return ***d*** in less than 30 seconds (read more about that in the *Clarifications and... |
[Question]
[
Related: [Validate a stem-and-leaf plot](https://codegolf.stackexchange.com/questions/93153/validate-a-stem-and-leaf-plot)
# Input
A non-empty list of positive integers. If needed, they can be taken as strings. You cannot assume it is sorted.
# Output
A [stem-and-leaf plot](https://en.wikipedia.org/wik... |
[Question]
[
# Task
Given two positive integers:
1. Draw the rectangle with dimensions specified by the two integers.
2. Repeat Step 3 until there is no more space.
3. Draw and fill the largest square touching three sides of the (remaining) rectangle.
4. Output the resulting rectangle.
# Example
For example, our in... |
[Question]
[
>
> *This question is the second of several Brain-flak Birthday challenges designed to celebrate Brain-Flak's first Birthday! You can find more information about Brain-Flak's Birthday [here](https://hackmd.io/KwRgnARiAcCGAsBaaEBMAGR8DG8Cmis0AZsVhPLOtsWAOzQAmIQA?view)*
>
>
>
# Challenge
For this cha... |
[Question]
[
## Definitions
You can skip this part if you already know the definitions of **groups**, **finite groups**, and **subgroups**.
### Groups
In abstract algebra, a *[group](https://en.wikipedia.org/wiki/Group_(mathematics))* is a tuple **(G, ∗)**, where **G** is a set and **∗** is a function **G × G → G**... |
[Question]
[
# Steganographic Squares
Your job is to take in a string, and generate an `NxN` image that represents this string. You must also write the algorithm that takes in the image and turns it back into a string as well. The scoring will be will include the byte count of both algorithms:
**"Encryption" Algori... |
[Question]
[
We'll define the **ASCII Odd/Even Cipher** via the below pseudocode:
```
Define 'neighbor' as the characters adjacent to the current letter in the string
If the one of the neighbors is out of bounds of the string, treat it as \0 or null
Take an input string
For each letter in the string, do
If the 0-... |
[Question]
[
[](https://i.stack.imgur.com/QDFZn.png)
This geometric spiral looks complicated, but it's fairly simple to draw; take the following box:
[](https://i.stack.imgur.com/Xfuu0.png)
Draw a straight line between the corn... |
[Question]
[
Create a Pascal's Triangle that is a nested list and contains zeros in the unused spots.
In the output array, the numbers of Pascal's Triangle are separated by zeroes and padded by zeroes on each side so that they are centered. For example, the bottom row (last sub-array) must have no zeroes on the lef... |
[Question]
[
When I was younger, I use to play a word game called [Word chain](https://en.m.wikipedia.org/wiki/Word_chain). It was very simple. The first player chooses a word; the next player says another word that starts with the same letter the previous word ended with. This goes on forever until somebody gives ... |
[Question]
[
## Introduction
In this challenge, we will simulate a certain [probabilistic cellular automaton](https://en.wikipedia.org/wiki/Stochastic_cellular_automaton) using very bad pseudorandom numbers.
The cellular automaton is defined on binary strings by the following local rule.
Suppose that the left neigh... |
[Question]
[
Consider a triangle *ABC* where each side has integer length (an *integral triangle*). Define a [median](https://en.wikipedia.org/wiki/Median_(geometry)) of *ABC* to be a line segment from a vertex to the midpoint of the opposing side. In the figure below, the red line segments represent the medians. N... |
[Question]
[
I wanted to fool a friend by giving him a [quine](http://en.wikipedia.org/wiki/Quine_(computing)) that *almost* worked, but became sloppier and sloppier.
Create a program that, when run, will output the program, but one character off. Either one character can be added, removed or both (one character ch... |
[Question]
[
Draw a tiled cube of any size, in ASCII art.
You will be given three numbers `a`, `b` and `c`, and the program should output an a\*b\*c sized cube.
**Examples**
`3 3 3` ->
```
____ ____ ____
/____/____/____/|
/____/____/____/||
/____/____/____/|||
|____|____|____|||/
|____|____|____||/
|____|___... |
[Question]
[
Given a matrix like this:
```
1 1 3 -2
3 -4 1 -1
1 1 1 0
0 -1 0 0
```
By taking a 2×2 "sliding sum", where the sum of every 2×2 region of the matrix is one element of the resulting matrix, we get:
```
1 1 1
1 -1 1
1 1 1
```
We can do this for sliding windows of any size. For example, a 1×3... |
[Question]
[
The input for the [continuous knapsack](https://en.wikipedia.org/wiki/Continuous_knapsack_problem) problem is as follows.
For each item 1...n we are given a positive weight and profit. Overall we are also given a positive capacity which is the maximum weight we can carry.
The goal is to pick items so t... |
[Question]
[
## Challenge
Your goal is to find the furthest point on a graph (from a provided start node). Your code doesn't need to handle cycles in the graph properly, but it might pose a fun challenge. For this question, you can assume the graph is actually a tree.
## Input data
Input can be provided in any suit... |
[Question]
[
Inspired by [this Puzzling challenge](https://puzzling.stackexchange.com/q/100507), and easier version of [my previous challenge](https://codegolf.stackexchange.com/q/209142/78410).
## Challenge
A 2D rectangular grid is given, where each cell is either an empty space or a wall. You start at the top 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.