# All Questions

14,045 questions
Filter by
Sorted by
Tagged with
2k views

### Doubleouble Talkalk

Input A non-empty string or list of capital letters k with length between 3 to 5000. Output A value indicating whether k can be ...
• 419
5k views

### First person to ever beat Classic Tetris

Historic Tetris Achievement Blue Scuti became the first ever human to beat the classic game of Tetris on NES. Here's the Tetris Kill Screen Challenge Output the following Tetris ...
• 2,163
604 views

### Binary Expansion Counting Sequence

I found another sequence not yet in the OEIS The binary expansion sequence is defines as follows, assuming 0 indexing: The even numbers of the sequence are how often 0 has appeared in the binary ...
• 12.5k
1k views

### Number of ways to partition n into n = K + ꓘ

In this challenge you are asked to find in how many ways we can express a positive integer n as the sum of two positive integers ...
• 24.9k
382 views

### Tips for golfing in Uiua

What general tips do you have for golfing in Uiua? I'm looking for ideas that can be applied to code golf problems in general that are specific to Uiua. (e.g. "remove comments" would not be ...
• 1,103
2k views

### Consecutive Composite Numbers

Challenge Generate $n-1$ consecutive composite numbers using this prime gap formula $$n!+2,n!+3,...,n!+n$$ Input An integer $n$ such that $3 \leq n \leq 50$. Output Sequence of $n-1$ ...
• 2,163
4k views

### How many people are awake?

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

• 2,896
2k views

### Mousetail's Sequence

I define mousetail'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 (i.e. no lower number ...
• 12.5k
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 ...
• 2,083
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,847
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,887
568 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 \...
• 4,163
599 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), ...
• 4,163
409 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,896
2k 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) ...
• 2,083
286 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.5k
1 vote
145 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 ...
• 335
411 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, ...
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: ...
• 4,163
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 ...
• 2,163
1k 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 ...
• 2,083
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,750
1 vote
508 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,896
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,896
473 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 ...
• 23.8k
725 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 ...
• 2,163
85 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)] ...
256 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,501
920 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.5k
583 views

• 48k
817 views

### Bloons TD 6 Ordered Upgrade Paths

Background The monkeys need your help again organizing their defense and have asked you, Benjamin the code monkey, to create a program that will list all tower upgrade options as they appear in your ...
• 12.1k
660 views

### Output all the different counts of points

Consider a 10 by 10 grid of points at integer coordinates. Given a coordinate (x, y) of one of the points in the grid and a radius r, some of the points in the grid will fall inside a circle of ...
• 2,896
682 views

### Official Tetris Piece Ordering

Classic Tetris was often a difficult game to play. One problem was that you could only work with the Tetris piece you were given, so if you had an awkward board, it would sometimes be difficult to ...
• 71
1k views

### Name the Dutch ancestor

The Dutch system for naming one's ancestors is a lot more interesting than the English version. For English, the sequence goes "parent", "grandparent", "great-grandparent"...
• 1,363
4k views

### The worst spaghetti code

Objective Write a full program that works exactly like the flow chart below. Each output, which is an integer, shall be through stdout, followed by a line feed. ...
• 5,941
973 views

### Output an infinitely proportional sequence

In this challenge, an infinitely proportional sequence is defined as a infinite sequence of positive integers such that: All positive integers are contained infinitely many times within the sequence. ...
• 37.8k
246 views

### golf a range with modulus and subtraction

if you have a range of numbers with values missing, eg l=[1,2,9,10,99], you can always use modulus and subtraction to make all the numbers in the list cover a ...
• 397
954 views

### Can their first appearance happen together?

Given two non-empty 01 strings, check if there is string containing both given strings, and their first appearance end at same position. Test cases: ...
• 23.8k
628 views

### How many points this side of the line

Input An integer n and a pair of distinct integer valued (x, y) coordinates on the boundary of the grid. The coordinates are indexed from 1. For example, n=10 and (1,2), (10, 7). The points will ...
• 2,896
194 views

### Inscribe a maximal regular polygon into a square image

You want to draw a regular polygon but you have limited space! In this challenge, you should draw a polygon with n sides which is as big as possible for a given square container image. I found ...
• 13.5k
733 views

### Convert from Spoken Binary

This is an exact inverse of the question Convert to Spoken Binary. This introduction is copied from there. Introduction In the video the best way to count, binary is proposed as the best system of ...
• 1,555
771 views

### Convert tiers between credit rating system

Related: Sort these bond ratings Credit rating agencies assign ratings to bonds according to the credit-worthiness of the issuer. The rating business is mostly controlled by "Big Three" ...
• 6,300
1k views

### Convert to Spoken Binary

Introduction In the video the best way to count, binary is proposed as the best system of counting numbers. Along with this argument is a proposal on how to say numbers in this system. First, we give ...
• 1,555