# All Questions

9,885 questions
214 views

### Graph 5-Coloring

Honestly, I can't believe this hasn't already been asked, but here it is Background Given a simple undirected planar (the graph can be drawn in the plane without intersections) graph, it is a proven ...
2k views

### Codegolf Rainbow : Draw in Black-and-White

Introduction: (Source: Wikipedia) When we look at a rainbow it will always have the colors from top to bottom: Red; orange; yellow; green; blue; indigo; violet If we look at these individual rings, ...
1k views

### Codegolf Rainbow : Fun with Integer-Arrays

Introduction: (Source: Wikipedia) When we look at a rainbow it will always have the colors from top to bottom: Red; orange; yellow; green; blue; indigo; violet If we look at these individual rings, ...
587 views

### Maximum Hamming distance among a list of padded strings

The Hamming distance between two strings of equal length is the number of positions at which the corresponding characters are different. If the strings are not of equal length, the Hamming distance is ...
831 views

### Make an alphabeTrie

Consider the following alphabetically sorted list of words: balderdash ballet balloonfish balloonist ballot brooding broom All of the words start with ...
331 views

### A Knotty situation [on hold]

sent back to the sandbox­­­­­­­­­­­­­­­­­ ­ ­ ­ ­
5k views

### Count Like a Babylonian

Challenge Given an ASCII representation of a Babylonian number as input, output the number in Western Arabic numerals. Babylonian Numeral System How did the Babylonians count? Interestingly, they ...
1k views

### Fill up to duplicate ranges

Let $L$ be a list of positive integers with no particular ordering, and which can contain duplicates. Write a program or function which outputs a list of positive integers $M$ (whose ordering is ...
2k views

### A knight's graph on an N-by-N board

In chess, a knight can only move to the positions marked with X relative to its current position, marked with ♞: A Knight's Graph is a graph that represents all legal moves of the knight chess piece ...
1k views

### RTA (Reverse-Then-Add) root of a number

The reverse-then-add (RTA) sequence is a sequence obtained by adding a number to its reverse, and repeating the process on the result. For eg.,  5 + 5 = 10 \Rightarrow 10 + 01 = 11 \Rightarrow 11 +...
206 views

### Goldbach's Comet

Back to back challenges I guess. Hopefully this one is more clear than the last. Background I was playing around with Goldbach's conjecture, and decided to plot evens (on the x-axis) vs the number ...
750 views

### When in Rome, Count as Romans do?

Background This challenge is inspired by this website, which published the following diagram: This diagram shows us that the longest Roman Numeral expression under 250 is that of 188, which requires ...
117 views

### number decomposition [duplicate]

It's been a while since I posted here, so here we go another day another challenge. Challenge : Given a number(n) split it into it's prime factors. Input : A ...
4k views

### Primality testing formula

Your goal is to determine whether a given number n is prime in the fewest bytes. But, your code must be a single Python 2 expression on numbers consisting of only ...
587 views

### Q​u​i​n​e R​e​l​a​y​!

Quine Relay! A quine relay of order $n$ is a series of programs $P_1\dots P_n$ in distinct languages such that each program $P_i$ outputs $P_{i+1}$ and $P_n$ outputs $P_1$. For example, ...
5k views

### Display a clock face

Display the 12 numbers on a clock face exactly like this: ...
411 views

### Minecraft Language Files Updater

In 1.13, Minecraft language files were switched from being a simple multi-line key=value format to JSON. Challenge Write a program converting from the original format returning a JSON string. Input ...
2k views

### Toggle some bits and get a square

Given an integer $N>3$, you have to find the minimum number of bits that need to be inverted in $N$ to turn it into a square number. You are only allowed to invert bits below the most ...
5k views
+100

### Gold Collector KoTH

Note: Further submissions will be ignored. The challenge is over. Watch for Gold Collectors KoTH 2.0 in a few weeks! In this KoTH, the aim is to be the last bot alive. Coins will be placed in random ...
1k views

### Greet according to the time of day

Challenge Write a program that greets a user depending on what time of day (GMT) it is. Output A string (printed or returned) according to these rules: If the time is 06:00 to 11:59 the greeting ...
91 views

### Php arrays code challenge [closed]

Given an array, write a function that will traverse the array and generate the array in a format given in the example below. For example, given the array: ...
1k views

### A function to take three integers and return a list of integers and alphabet-letters

Challenge We take three positive integers a, b, and c as input. Using these integers, first ...
317 views

### Watch the bookie win

When you roll a die, you have a 6:1 chance of any given option. There's a bookmaker taking bets on die rolls. He owns £20 at the start of the game. The bookmaker offers odds of 4:1, but gamblers ...
1k views

### crossed out 44 is still regular 44 ;(

Introduction On March 24th, 2015 @isaacg golfed his Pyth answer from 44 to 42 bytes. Since a crossed out 44 (44) looks a lot like a regular 44, @Optimizer made the following comment: striked out ...
663 views

### Scoring 6,5,4 (AKA Ship, Captain, and Crew)

Inspired and looted from this dice challenge by Arnauld Input You are given a 5x1 or 1x5 (your choice) dice matrix which consist of binary 3x3 sub-matrices. Goal Given a valid dice matrix, you are ...
96 views

### Symmetric Numbers [duplicate]

write a function to tell if a number is symmetric or not. for example: input: 151 output: True input: 142 output: False and so on: 1111 True, 2390 False, 1226221 True
2k views

### Calculate the sum of the first n prime numbers

I'm surprised that this challenge isn't already here, as it's so obvious. (Or I'm surprised I couldn't find it and anybody will mark it as a duplicate.) Task Given a non-negative integer $n$, ...
361 views

### Golf a Solubility Chart

Given the name of a cation and anion, output "S" (soluble) or "I" (insoluble). The table we will be using is from wikipedia: https://en.wikipedia.org/wiki/Solubility_chart. It is copied at the end of ...
576 views

### Split the bits!

We define $V(x)$ as the list of distinct powers of $2$ that sum to $x$. For instance, $V(35)=[32,2,1]$. By convention, powers are sorted here from highest to lowest. But it does not affect ...
2k views

### Naismith's rule

Naismith's rule helps to work out the length of time needed for a walk or hike, given the distance and ascent. Given a non-empty list of the altitude at points evenly spaced along a path and the ...
155 views

### Evaluate Words Based on “Rules” (Skeptics.SE Crossover)

I came across this picture, which I initially questioned and thought about posting to Skeptics. Then I thought they'll only tell me if this one case is true, but wouldn't it be great to know how true ...
64 views

### Shortest quine that is a palindrome. No comments [duplicate]

I challenge you to write the shortest code possible to produce a quine that is a palindrome. The quirk here is that you are not allowed to use any comment functionality. Rules: Shortest code wins ...
2k views

### Belarus rushnyk

We've got quite a few national flag challenges already: AU CH FI FR GB GB IS KR NP US... Here's another, somewhat more advanced one: Return or print the decorative pattern from Belarus's national ...
3k views

### Most Common Multiple

Not to be confused with Least Common Multiple. Given a list of positive integers with more than one element, return the most common product of two elements in the array. For example, the MCM of the ...
298 views

### Minimal Centrosymmetrization

Topically related. Objective: Given a matrix of positive integers $M$, output the smallest centrosymmetric matrix which contains $M$ (this matrix may contain non-positive integers as well). A ...
5k views

### Is the bus load legal?

I was in the bus today, and noticed this sign: ...
97 views

### make this bubble sort python code shorter than this? [closed]

i don't know if it can be made shorter than this ...
77 views

### Make the super number hyper-pyramid [duplicate]

Challenge Given a positive integer $n$, output the $n$-dimensional pyramidal list. Example $n = 1$: Objects arranged in a 1D pyramid (line) with side length 1 is just by itself. So, the ...
535 views

### Decrypt the extended Wechsler format

This challenge is based on a sandbox post by user48538. Since he is no longer active on this site, I took over this challenge. apgsearch, the distributed soup search program for Conway's Game of Life ...
114 views

### Plotting Julia set in Complex analysis

The Julia set is the set of complex numbers z that do not diverge under the following iteration: z=z^2+c, Where c is a constant complex number. Different values of z reach infinity at different rates. ...
148 views

### Optimal Caching

You will be given a sequence of memory requests and a cache size. You must return the least possible number of cache misses under any cache replacement strategy. An optimal strategy is Belady's ...
1k views
+500

### Make a Geiger Counter

A Geiger counter is a device that is used to detect radiation. We will be making a Geiger counter program. As we all know, when radiation hits a computer program it removes exactly 1 byte at random. ...
175 views

### Bridge Deal Scoring

Goal Given a deal result from Duplicate Contract Bridge, calculate the deal score. Basically the same as iBug's question, which was deleted. I figured out this scoring system while trying to answer ...
2k views

### How much is my dice matrix worth?

Input A non-empty binary matrix consisting of 3x3 sub-matrices put side by side. Task Your task is to identify valid dice patterns (as described below) among the 3x3 sub-matrices. Each valid ...
129 views

### Map an array of functions to their return values in point-free style

Introduction I have some JavaScript code that uses Array.prototype.map to map an array of functions fns to their return values: ...
202 views

### Python: shortest way to interleave items from two lists

I'm trying to get the shortest way (character possible) to obtain List 3. List 1 and List 2 are already given to me as arguments and are the same length. ...
4k views

### Roman Army Shields

Sandbox post (deleted) The old roman army formations are very famous around the world. In these formations roman legionaries grouped in a geometric shape (usually a rectangle) protecting the flanks ...
4k views

### Stack Exchange Stock Exchange - V3

NOTICE: This challenge is now closed: I will no longer be updating the leaderboard and will not change the accepted answer. However, you are free to run the controller and update the leaderboard ...
500 views

### The Clock Hands of Doom

You are chained to a chair. Underneath you is a huge volcano. A 12-hour clock next to you ticks ominously, and you see that it has wires leading from the back up to a chain, which will drop you into ...
3k views

### Test if a string is parenthesly balanced

We call a parens group the open paren (, its matching close paren ) and everything inside them. A parens group or string is ...

15 30 50 per page