# All Questions

10,428 questions
413 views

### Mis-decode a date

Background Inspired by a now deleted question by John Burger from which I quote: Now obviously no human made this mistake. It's a mis-decode of something - perhaps the ISBN? My question is: ...
2k views

### Multi-level marketing “legs” investment rule

Multi-level marketing related challenge. A peer wants to get rewarded. So it attracted N investors (N>=1), each i-th ...
128 views

### Pattern Finder - Find Repeated Pattern in String [closed]

Introduction This is a little challenge with the goal of identifying repeated pattern "blocks" in a string, and outputting them with their frequency of occurence from left to right. A friend asked ...
877 views

### Write a function/method that takes in a string and spells that word out using the NATO Phonetic Alphabet. Titlecase optional

Write a program that takes in a string and spells that word out using the NATO Phonetic Alphabet. The mapping is as follows: ...
1k views

### How many consecutive descending numbers in my number?

2019 has come and probably everyone has noticed the peculiarity of this number: it's in fact composed by two sub-numbers (20 and 19) representing a sequence of consecutive descending numbers. ...
245 views

### Execute Triangularity Move

TL;DR for those not interested: Look at the test cases at the bottom. Have a program/function that outputs the 2D list displayed for the given input. Introduction: On November 15th, 2018 puzzle ...
1k views

### Clock (transliterate) Cipher

Introduction: I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too ...
10k views

### Oreoorererereoo

Oreoorererereoo Given an input string that is similar to the word "oreo", give an ASCII representation of the cookie that is as wide as the input string (to ensure cookie stability). Rules The ...
291 views

### Surreal Numbers

Surreal Numbers Surreal numbers are one way of describing numbers using sets. In this challenge you will determine the value of a surreal number. Intro A surreal number consists of two sets: a left ...
78 views

### Remove indentation [duplicate]

Write a program which removes any common leading spaces from the input string. For example, if the least indented line started with 3 spaces, and every other line has ...
812 views

### Length of the Longest Descent

Your task is to determine the length of the longest descent down a "mountain" represented as a grid of integer heights. A "descent" is any path from a starting cell to orthogonally adjacent cells with ...
2k views

### Find if a list is an ABC-triple

Three positive integers A, B, C are ABC-triple if they are coprime, with A < B and satisfying the relation : A + B = C Examples : 1, 8, 9 is an ABC-triple ...
156 views

### Min-Max GHC command line error bytes to bytes of source code

GHC command line errors can be horrible, lets make them as bad as possible. To disincentivize very long programs use the following formula to calculate your "score". ...
98 views

### Order of Elements of the Rubik's Cube [duplicate]

Introduction All the possible moves and their combinations of a Rubik's Cube form a group. A group in general is a set with some binary operation defined on it. It must contain a neutral element with ...
46 views

### Polynomial to String [duplicate]

I'm new to code-golf, but I was trying to solve this problem myself, and thought there must be a much "better"/shorter way of doing it. Given a sequence (list) of numbers $a_0, a_1,\cdots,a_n$, ...
2k views

### Collapsing numbers

Let's define the a function on natural numbers $n$, written as base 10 digits $d_k\; d_{k-1}\; \dotsc\; d_1\; d_0$, as follows: As long as there are equal adjacent digits $d_i\;d_{i-1}$, ...
1k views

### Get the date of the nth day of week in a given year and month

Introduction Often, people refer to dates as the "second Friday in August, 2018" or the "fourth Sunday in March, 2012". But it's hard to tell what date that is! Your task to is to write a program ...
761 views

### Most contributing rows

Given a non-empty matrix of non-negative integers, answer which unique rows contribute most to the sum total of elements in the matrix. Answer by any reasonable indication, for example a mask of the ...
442 views

### Count the contiguous submatrices

Migrated from chat Given two non-empty non-negative integer matrices A and B, answer the number of times A occurs as a contiguous, possibly overlapping, submatrix in B. Examples/Rules 0. There may ...
121 views

### All the digisibles [duplicate]

A natural number (written in the decimal base) is qualified as digisible if and only if it fulfills the following 3 conditions: none of its digits is zero, all the digits that compose it are ...
191 views

### Find equally-weighted complete graphs

Graph theory is used to study the relations between objects. A graph is composed of vertices and edges in a diagram such as this: ...
426 views

### Corrupting A Binary File By Interpreting It As Text

Using FTP's ASCII mode to transfer binary files is a bad idea. It is likely to corrupt your data. Badly. Let's simulate this corruption! Your task is to write a program which takes a file as input ...
2k views

### Eight coins for the fair king

This is a "counterpart" of another puzzle, Eight coins for the fair king on Puzzling.SE. You can read the above puzzle for the background. The details about this puzzle are as follows. A set of 8 ...
5k views

### Encode the date in Christmas Eve format

The day this post was published was Christmas Eve. Tomorrow will be Christmas. Yesterday was Christmas Eve Eve. In two days it will be ...
217 views

Inspired (you don't need to know them for this challenge) by the Pumping Lemma for various languages, I propose the following challenge: choose some basis $B \geq 2$ and an integer $n \geq 0$ ...
1k views

### Dungeon Crawler

Input A binary matrix $M$ representing the walls of a dungeon. The position $(x,y)$ of the player within the dungeon. The direction $d$ that the player is currently facing (0 = North, 1 = East, ...
372 views

### Just Twice Is Nice

Let's have string multiplication to take a string and a positive number and concatenate that string that many times. In Haskell: ...
1k views

### Does this Set Represent a Natural Number?

In set theory, the natural numbers $\mathbb{N} = \{0, 1, 2, 3, ...\}$ are usually encoded as pure sets, that is sets which only contain the empty set or other sets that are pure. However, not all ...
2k views

### Translate English to Corpus

The Corpus are a fictional faction from the popular video game Warframe who have a somewhat interesting language. Whilst other factions in the game such as the Grineer have some logic behind their ...
1k views

### Smallest Diversifying Exponent

A pandigital number is an integer which contains every digit from 0 to 9 at least once. 1234567890, 1902837465000000, and 9023289761326634265 are all pandigital. For the purposes of this challenge, ...
2k views

### Parse the Bookworm dictionary format

I've recently been indulging myself in some nostalgia in the form of Bookworm Deluxe: In case you haven't seen it before, it's a word game where the goal is to connect adjacent tiles to form words. ...
242 views

### What will be on the top of this decorative calendar?

Someone gave my wife a decorative calendar consisting of four cubes. Here it is showing today's date (as of the posting of this challenge) on the front: When I first saw it, I looked at it from the ...
2k views

### Coat of Many Colours

Challenge Given a list of unique colour names as input, sort them in the order that they first appear in Joseph's Amazing Technicolour Dreamcoat. Example ...
263 views

### Optimizing swiping across a 1D keyboard

This is a code-challenge with a custom scoring system, where the lowest score wins. Introduction Many smartphones allow to enter text by swiping your finger across the 2D virtual keyboard. This ...
9k views

### A game of dice, but avoid number 6

Tournament over! The tournament is now over! The final simulation was run during the night, a total of $3*10^8$ games. The winner is Christian Sievers with his bot OptFor2X. Christian Sievers also ...
2k views

### Non-overlapping Matrix Sum

Non-overlapping Matrix Sum Given k arrays of length n, output the maximum sum possible using one element from each array such that no two elements are from the same index. It is guaranteed that k<=...
325 views

### Approximate the proportion of integers with neighboring factors

If 1 is not counted as a factor, then 40 has two neighboring factors (4 and 5) 1092 has two neighboring factors (13 and 14) 350 does not have two neighboring factors (out of its factors 2, 5, 7, 10, ...
2k views

### Rotation invariant fingerprinting

Imagine we have some 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 ...
1k views

### Standardize the Samples (Compute the z-Score)

Given a list of floating point numbers, standardize it. Details A list $x_1,x_2,\ldots,x_n$ is standardized if the mean of all values is 0, and the standard deviation is 1. One way to compute this ...
2k views

### How many syllables in that number?

I'd love to take a number and know how many syllables are in it, when spoken in English. Let's limit this to positive integers which are less than one thousand. I'm British, so we're going to follow ...
70 views

### Sino-Korean numerals [duplicate]

The Korean language has two sets of numerals, a native Korean numerals and Sino-Korean numerals. The native Korean numerals are mostly used for numbers under 100, such as age and time. The Sino-...
2k views

### Convert to Suzhou numerals

Suzhou numerals (蘇州碼子; also 花碼) are Chinese decimal numerals: 0 〇 1 〡 一 2 〢 二 3 〣 三 4 〤 5 〥 6 〦 7 〧 8 〨 9 〩 They pretty much work like Arabic numerals, except ...
3k views

### How much candy can you eat?

Credit to Geobits in TNB for the idea A post without sufficient detail recently posited an interesting game: 2 children sit in front of an array of candy. Each piece of candy is numbered 1 to ...
482 views

### A spiral sequence

Background OEIS sequence A272573 describes a spiral on a hexagonal grid as follows: Start a spiral of numbers on a hexagonal tiling, with the initial hexagon as a(1) = 1. a(n) is the smallest ...
4k views

### Draw some expanding arrows

This challenge is about printing a series of growing ASCII-art arrows. I'll describe the pattern in words, but it might be easier to look at what the start of this series looks like: ...
354 views

### Hilbertize an image

For a computer vision app I want to do a mapping of an image, in such a way that every pixel fit hilbert curve, instead of conventional layout. So task could be as follows: Task description Given ...
347 views

### Print coordinates of an NxN grid [duplicate]

Question: Print out all the coordinates of a NxN grid. Preferably in C, however other languages also accepted Input: N (integer) Output: for N=3, a 3x3 grid: ...
1k views

### Iron particles around a magnet

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 ...