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.

Filter by
Sorted by
Tagged with
11 votes
17 answers
957 views

A redundant regular expression (regex) is defined here as a regex which has some amount of characters which can be removed while not affecting its functionality -- i.e. it matches the exact same set ...
97.100.97.109's user avatar
10 votes
2 answers
379 views

Task: Your task is make a program to check if there exists integers \$a \ge 2, b \ge 2\$ such that \$a^b=i\$ where \$i\$ is the input integer at least 2. The catch is that your program must return a ...
Fmbalbuena's user avatar
  • 5,105
15 votes
17 answers
2k views

Problem 4 of the 2025 International Mathematical Olympiad asked (paraphrased): Let \$f(n)\$ be the sum of the largest three proper divisors of \$n\$, that is divisors excluding \$n\$ itself. For ...
xnor's user avatar
  • 150k
23 votes
15 answers
3k views

Your task is to write two programs/functions, in the same language. Program 1: Verify that two inputs are anagrams of each other. Program 2: Verify that two inputs differ from each other at every ...
Steve Bennett's user avatar
12 votes
3 answers
2k views

Find an NP-complete problem that covers all finite ASCII strings, and present a solver for the problem in the programming language of your choice. By the definition, if there is a finite ASCII string ...
Dannyu NDos's user avatar
  • 7,381
28 votes
42 answers
4k views

Given a character as input, determine if your source code contains that character or not. Shortest code wins. Though, I'd like to see some "normal" languages too. UPDATE: the question ...
YurichBRO's user avatar
  • 333
8 votes
12 answers
684 views

The Array Walker (part 2) Input: A non-empty array of integers (without nesting1). This can have negative values! Output: A boolean value2 indicating whether we can reach the end of the array when ...
QOO-OOKALAN's user avatar
8 votes
23 answers
977 views

Can we escape from the array? Input: A non-empty array of non-negative integers (without nesting1). Output: A boolean value2 indicating whether we can reach the end of the array when starting from the ...
QOO-OOKALAN's user avatar
10 votes
2 answers
706 views

Challenge Given two line segments, your goal is to write a function which determines if they intersect using only the operations given below: Multiplication: x*y ...
CursorCoercer's user avatar
3 votes
2 answers
220 views

You will be given a matrix. It contains a ride exit (with a direction), some path, as well as some obstacles. Your goal is to build the longest possible queue line in that space, which connects the ...
Ted's user avatar
  • 2,407
13 votes
7 answers
988 views

Update 2025-06-04: Thanks for the submissions everyone! It seems like a lot of the solutions are quite slow / timeout for the 100 length test case, so I don't think any will be able to do the 10k. ...
Ted's user avatar
  • 2,407
16 votes
12 answers
4k views

You will be provided with a string containing a digital clock. You must determine how many times per day that clock could be correct. You can ignore daylight savings time. You do not know if the clock ...
Ted's user avatar
  • 2,407
7 votes
4 answers
724 views

Ray has created some ASCII lines which he is using to draw with on a canvas. His canvas can be any width and height between 1 to 100 characters (the borders do not count towards these dimensions). He ...
Ted's user avatar
  • 2,407
13 votes
18 answers
2k views

A046386 is the sequence of all natural numbers that are the product of exactly 4 distinct primes. Write the shortest program, function, or code snippet, that, when given a natural number, outputs ...
bigyihsuan's user avatar
  • 11.5k
9 votes
2 answers
227 views

Given a list of values, 1, 2, -1, or -2, we will allow the following simple moves: Remove adjacent values which are negatives of each other. e.g. ...
Wheat Wizard's user avatar
  • 103k

15 30 50 per page
1
2 3 4 5
54