# All Questions

13,990 questions
Filter by
Sorted by
Tagged with
4k views

### How many people are awake?

The following data contains the (approximate) population of each UTC timezone in the world (source): ...
• 1,941
1k views

• 2,760
2k views

### Mousetail's Sequence

I define mousetails's sequence as follows: If the nth element of the sequence is q, then n+1 must appear q times in the sequence The sequence is weakly monotonically increasing (eg. no lower number ...
• 12.4k
1k views

### Find the child anagrams of a word

Select any word from https://websites.umich.edu/~jlawler/wordlist with length greater than 1. For each letter on that word, remove it and check if any rearrangement of the remaining letters is present ...
• 1,941
2k views

### Divmod continuously until the remainder is 1 or 0, then get the remainder

The task is simple, divide, get the quotient and the remainder, and if the remainder isn't 1 or 0, do the same thing (quotient divmod remainder) until the remainder is 1 or 0, then get the remainder. ...
• 3,831
1k views

### How much do you win in the Bingo Golf Flax Lottery?

The challenge, should you accept it, is to determine how much you win in the Bingo Golf Flax Lottery. Based on but not equal to the BingoFlax lottery The input is two lists of numbers (positive non-...
• 5,857
547 views

### Can you decrypt me? (Robbers)

Can you decrypt me? Robbers Find any combination of $n$ working chars to change and what they should change into, where $n$ is chosen by the cop. You cannot change less than n chars, only exactly \...
• 3,823
1 vote
584 views

### Can you decrypt me? (Cops)

Can you decrypt me? Cops Cops, post obfuscated code that hides a number $n$ (n must not be greater than the program length) inside its code. If $n$ chars are changed (no additions or deletions), ...
• 3,823
405 views

### Find a fraction with the smallest denominator

Input Two non-negative floating point numbers $x < y$. You can assume they are close enough to each other that there is no integer between $x$ and $y$. Output A fraction with the smallest ...
• 2,760
1k views

### Validate a CPF number

Every Brazilian citizen has a national identification number associated with them, named CPF. This number has 11 digits (formatted as XXX.XXX.XXX-XX) and it's validated by the following (real) ...
• 1,941
279 views

### Print "abracadabra" with 7 different alterations

Abracadabra is a magic word. To make it even more magical, let's make several alterations to how it may be written: Change the casing for any subset of characters; for example: ...
• 13.4k
139 views

### Exact Sum of 1/2 to 1/n [duplicate]

Consider the sequence 1/2, 1/3 + 1/2, 1/4 + 1/3 + 1/2, and so on. In mathematical symbols, this is $$S(n)=\sum_{m=2}^{n+1}\frac{1}{m}$$ where S is the function that makes the sequence. Outputting this ...
• 315
388 views

### Heart plus diamond is spade-and-club: table puzzle

I found this YouTube video with a table on it showing some card suits with ampersands. You might not understand what it is about, but I still want to make a challenge about it. The input is two suits, ...
• 245
3k views

### "Perfect" an array

Given an n non-negative integers, how many numbers must be changed so that each number x appears x times? You cannot add or remove elements, only replace them with other numbers. For example: ...
• 3,823
1k views

### Counting Collinear Points

Given two points $(x_1, y_1)$ and $(x_2, y_2)$ with integer coordinates, calculate the number of integer points (excluding the given points) that lie on the straight line segment joining these two ...
• 1,603
992 views

### Implement a typeface based on a 3x3 bitmap matrix

Input A single-character string containing an uppercase or a lowercase letter from the English alphabet. Alternatively, you may handle only uppercase or only lowercase letters as input. Output This ...
• 1,941
2k views

### Shortest path to open a letter lock

This quite literally came to me in a dream. A common combination padlock design has letters on the dials so you can set the combination to a word. Unfortunately, I can't read, but I can count. ...
• 3,300
1 vote
504 views

### Find the optimum circle in an infinite grid

Consider an $n \times n$ grid of integers which is part of an infinite grid. The top left coordinate of the $n \times n$ grid of integers is $(0, 0)$. The task is to find a circle which when ...
• 2,760
5k views

### Calculate 500 digits of e

Write a program to calculate the first 500 digits of the mathematical constant e, meeting the rules below: It cannot include "e", "math.e" or similar e constants, nor may it call ...
• 2,760
464 views

### Coin sequence probability

Given two strings containing only 0 and 1, decide the probability that first appears earlier as a consecutive substring in an ...
• 22.3k
696 views

### Displaying Inky the ghost from Pac-Man using ANSI escape codes

Challenge Display Inky the ghost from Pac-Man using only ANSI escape codes. Here's a text representation of the image ...
• 1,603
76 views

### Shortest way to print the first 20 numbers in the fibbonacci sequence with python3 [duplicate]

I was wondering if it was possible to make this code even shorter than it already was. f=lambda x:f(x-1)+f(x-2) if x>1 else 1 [print(f(i))for i in range(20)] ...
239 views

### Forward foo, reverse bar, but avoid dead code [closed]

So simple: Provide some code that outputs foo and with the reversed source outputs bar. But before you come up with something ...
• 2,251
902 views

### Unnecessary Fluff

Following the great advice (what do you mean it's not advice?!) on Adding unnecessary fluff we can devise the following task: Take a list of positive integers and a positive integer $m$ as input. ...
• 10.3k
568 views

• 2,760
432 views

### Stably sort N elements in this restricted "cmov" language

The following problem is taken from the real world — but indubitably code-golf! In this puzzle, the programming language is fixed, and your job is to write the most ...
• 793
6k views

### Am I vaccinated?

Disclaimer: the content of this post is not medical information and should not be used for any medical purpose, as it is deliberately oversimplified for the purpose of the challenge. There are several ...
• 1,520
273 views

### Translate Japanese hiragana into the flick input method

The flick input method is a way of inputting Japanese kana on a modern smartphone. It is arranged in a 12-key layout, with the following labels: あかさ たなは まやら 小わ、 ...
• 8,978
2k views

### Test whether a sequence is bitonic

You know what a monotonic sequence is: each element is bigger than its predecessor (monotonically rising) or as its successor (monotonically falling). Bitonic means you have two arms of the sequence, ...
• 2,251