Skip to main content

# Questions tagged [decision-problem]

For challenges which involve deciding whether or not the input meets certain criteria, and outputting some data, representing that decision.

758 questions
Filter by
Sorted by
Tagged with
22 votes
1 answer
728 views

### Can you draw this in one stroke?

Related | Related Given an ASCII art with |, _, and , check if you can draw the art in one ...
• 9,408
20 votes
20 answers
2k views

### Can the Tune be Played?

Can the Tune be Played? Explanation A broken musical keyboard has keys labelled with positive integers. It is broken in two ways: It takes a long time to process key presses: after pressing the key ...
• 1,155
20 votes
21 answers
3k views

### Gambling with an Alien

You met a 4-th dimensional being who challenged you to a game of dice. The rules are simple: each player rolls 3 6-sided dice and takes the sum of each combination of 2 dice. The player with the ...
• 391
12 votes
3 answers
636 views

### Solve an alien wordle

You've arrived on an alien planet. The writing system, the culture and the language there are completely foreign to any language you know. But somehow they are all playing wordle already. So as a ...
• 99k
15 votes
8 answers
668 views

### Is it a sub-permutation?

A finite-permutation is a function which takes an $n$-tuple and produces an $n$-tuple such that every element of the input is present in the output, and the ordering does not rely on the values of ...
• 99k
19 votes
28 answers
2k views

### Is it a tower permutation?

A tower is made out of layers, each one being one unit shorter than the one below it. Every layer is completely on top of the previous layer. For example, here is a tower along with it's height map: <...
• 7,898
31 votes
35 answers
3k views

### Is it a fibonacci-like sequence?

The Fibonacci Sequence is a sequence of positive integers where the first two elements are 1 and the rest are the sum of the previous two. It begins $1, 1, 2, 3, 5, 8, 13$ and continues forever. But ...
• 39.2k
16 votes
2 answers
892 views

### Golf the prime numbers in Shue

I'd like to introduce a new? programming language I call Shue (Simplified Thue). It has very simple syntax. Here is a program that checks if an input is divisible by three: ...
• 7,898
15 votes
3 answers
348 views

### Is it a bigger regex?

You are given two regexes and your task is to determine if the strings matched by the first regex are a subset of the strings matched by the second regex. For this we are going to use a limited ...
• 7,898
21 votes
21 answers
2k views

### Is given number a concat of two squares

Given a positive integer, determine if it can be represented as a concatenation of two square numbers. Concatenated numbers may not begin with 0 (except for 0). Any leading zeros in input should be ...
• 237
5 votes
3 answers
638 views

### Mahjong Checker

Mahjong is a tabletop game played using tiles. It features three "number" suits (pins, sous, mans, represented as p, s ...
• 5,099
20 votes
1 answer
530 views

### Can I wall glitch to there?

Background In a 2d game that I play, each screen is a 2d grid of tiles with walls and walkable tiles, with the player only able to travel on walkable tiles, and being stopped by walls. When the player ...
• 13.7k
7 votes
9 answers
2k views

### Write a spam-detection program

You work for a social media platform, and are told to create a program in a language of your choice that will automatically flag certain post titles as "spam". Your program must take the ...
• 707
23 votes
34 answers
3k views

### Sum of two squares

Given a nonnegative integer $n$, determine whether $n$ can be expressed as the sum of two square numbers, that is $\exists a,b\in\mathbb Z$ such that $n=a^2+b^2$. ...
• 4,974
22 votes
6 answers
807 views

### Check if a matrix is Zarankiewicz-maximal

My final-year project at the National University of Singapore is on Zarankiewicz's problem: What is the maximum number of 1s in an $m×n$ binary matrix ($m$ rows and $n$ columns) with no $a×b$ ...
• 3,845
10 votes
4 answers
293 views

### Is it a possible Hearts result?

Hearts is a 4-player game that uses the following scoring rules: Everyone starts with score 0. Each round every player gets a non-negative amount of points. The sum of the points is 26, and at least ...
• 24.9k
17 votes
28 answers
1k views

### Reversed Multiple Pair

Intro Two numbers are a reversed multiple pair if they satisfy the following property: $$a\cdot b = \operatorname{reversed}( (a-1)\cdot b )$$ Here, $\operatorname{reversed}()$ means to reverse the ...
• 4,193
12 votes
8 answers
534 views

### Is there a stable way to stack these?

If we have a binary matrix then we will say that a $1$ is stable if it is in the bottom row or it is directly adjacent to a $1$ which is stable. In other words there must be a path to the bottom ...
• 99k
21 votes
4 answers
933 views

### Is this hexagon symmetric?

TLDR: This is the hexagonal version of Is this square symmetrical? Given a hexagonal grid, decide if it is symmetric. The shape of the grid is a regular hexagon. Each cell in the grid has two possible ...
• 48.7k
30 votes
9 answers
678 views

### Predicting pumpkin planting plans' potential problems

You are going to be planting pumpkins soon, and you are preparing your supplies. Pumpkins come in all sorts of sizes and have their sizes written on the seed bag. A pumpkin that is size n will grow ...
• 99k
19 votes
25 answers
1k views

• 50.1k
24 votes
29 answers
3k views

### AoCG2021 Day 2: Naughty or nice?

Part of Advent of Code Golf 2021 event. See the linked meta post for details. The story continues from AoC2015 Day 5, Part 2. Santa needs help figuring out which strings in his text file are naughty ...
• 77.5k
21 votes
5 answers
3k views

### Will one-cell brainfuck halt?

Brainfuck is an esoteric programming language that is Turing Complete, meaning you can't tell whether a given program will halt without running it. It's cell-based and has an infinite tape of cells, ...
• 39.2k
29 votes
31 answers
3k views

### Open or Close the Parentheses

Every phone needs a calculator app. Because of the limited screen real estate, the developer of mine has decided to save some buttons. Instead of having two dedicated bracket buttons - one for open <...
• 7,414
18 votes
21 answers
2k views

### Digit small numbers

A digit small number is a positive integer $n$ such for any two numbers that multiply to $n$, their total number of digits is more than the digits in $n$. In otherwords: there are no two ...
• 99k
28 votes
12 answers
2k views

### Infinite ordinals from a well-ordering

Your task is to write a short program that represents a large (infinite) ordinal, using a well-ordering of the set of positive integers. Your program will take two different positive integers and ...
• 7,898
19 votes
6 answers
795 views

### Is it an elementary matrix?

Consider a linear system of equations, in $n$ unknowns, expressed as $$A \textbf x = \textbf b$$ where $A \in M_{n,n}(\mathbb Z)$ is an $n \times n$ matrix of integers, $\textbf x$ is a column ...
• 50.1k
9 votes
2 answers
262 views

### A rolling drop gathers all pearls?

Quell is a single-player grid-based puzzle game. Pearls are scattered across a 2D map and the aim is to collect them all by rolling a drop of water over them. For this challenge we will only consider ...
• 11.2k
21 votes
4 answers
2k views

### Crossing a river with weird animals

Background One kind of river-crossing problems involves two kinds of animals. One such problem reads like this: (all wordings, including animal species, are arbitrary) A farmer has to cross a river ...
• 77.5k
20 votes
7 answers
5k views

### Is This Scrabble Board Valid?

Background Scrabble is a word game in which players collaboratively build a board consisting of letter tiles that spell words. Each word must be connected to another word, and players gain points ...
• 1,513
19 votes
15 answers
2k views

### Is it a prefix normal word?

Prefix normal words arise in the context of binary jumbled pattern matching. A binary word $w$ consisting of $0$s and $1$s is said to be prefix normal * if, among all of its substrings, none ...
• 11.2k
17 votes
9 answers
963 views

### Maybe fractal sequence?

Background A fractal sequence (Wikipedia; MathWorld) is an infinite sequence of positive integers meeting the following conditions: Each positive integer appears infinitely many times in the sequence....
• 77.5k
15 votes
2 answers
620 views

### Is this Flow Free puzzle trivial?

Background Flow Free is a series of puzzle games whose objective is to connect all the same-colored pairs of dots on the grid. In this challenge, we consider the original game on a rectangular grid (...
• 77.5k